Part Number Hot Search : 
N455000S ICE15N60 JANTX1 TMP87P AAT1232 2SK3013 CIL148C TC1412
Product Description
Full Text Search
 

To Download TMP19A43CZXBG Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 32bit TX System RISC TX19A Family TMP19A43CD/CZXBG
Rev2.0
2007.Aug.31
TMP19A43
32-bit RISC Microprocessor - TX19 Family
TMP19A43CZXBG, CDXBG TMP19A43FZXBG, FDXBG 1. Overview and Features
The TX19 family is a high-performance 32-bit RISC processor series that TOSHIBA originally developed by integrating the MIPS16TMASE (Application Specific Extension), which is an extended instruction set of high code efficiency. TMP19A43 is a 32-bit RISC microprocessor with a TX19A processor core and various peripheral functions integrated into one package. It can operate at low voltage with low power consumption. Features of TMP19A43 are as follows:
RESTRICTIONS ON PRODUCT USE
070122EBP
* The information contained herein is subject to change without notice. 021023_D * TOSHIBA is continually working to improve the quality and reliability of its products. Nevertheless, semiconductor devices in general can malfunction or fail due to their inherent electrical sensitivity and vulnerability to physical stress. It is the responsibility of the buyer, when utilizing TOSHIBA products, to comply with the standards of safety in making a safe design for the entire system, and to avoid situations in which a malfunction or failure of such TOSHIBA products could cause loss of human life, bodily injury or damage to property. In developing your designs, please ensure that TOSHIBA products are used within specified operating ranges as set forth in the most recent TOSHIBA products specifications. Also, please keep in mind the precautions and conditions set forth in the "Handling Guide for Semiconductor Devices," or "TOSHIBA Semiconductor Reliability Handbook" etc.
021023_A
* The TOSHIBA products listed in this document are intended for usage in general electronics applications (computer, personal equipment, office equipment, measuring equipment, industrial robotics, domestic appliances, etc.). These TOSHIBA products are neither intended nor warranted for usage in equipment that requires extraordinarily high quality and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury ("Unintended Usage"). Unintended Usage include atomic energy control instruments, airplane or spaceship instruments, transportation instruments, traffic signal instruments, combustion control instruments, medical instruments, all types of safety devices, etc. Unintended Usage of TOSHIBA products listed in this document shall be made at the customer's own risk. 021023_B * The products described in this document shall not be used or embedded to any downstream products of which manufacture, use and/or sale are prohibited under any applicable laws and regulations. 060106_Q * The information contained herein is presented only as a guide for the applications of our products. No responsibility is assumed by TOSHIBA for any infringements of patents or other rights of the third parties which may result from its use. No license is granted by implication or otherwise under any patents or other rights of TOSHIBA or the third parties.
070122_C
* The products described in this document are subject to foreign exchange and foreign trade control laws. 060925_E * For a discussion of how the reliability of microcontrollers can be predicted, please refer to Section 1.3 of the chapter entitled Quality and Reliability Assurance/Handling Precautions. 030619_S
TMP19A43 (rev2.0) 1-1
Overview and Features
TMP19A43
(1) TX19A processor core 1) Improved code efficiency and operating performance have been realized through the use of two ISA (Instruction Set Architecture) modes - 16- and 32-bit ISA modes. * * 2) The 16-bit ISA mode instructions are compatible with the MIPS16TMASE instructions of superior code efficiency at the object level. The 32-bit ISA mode instructions are compatible with the TX39 instructions of superior operating performance at the object level.
Both high performance and low power dissipation have been achieved. High performance * * * * * * * Almost all instructions can be executed with one clock. High performance is possible via a three-operand operation instruction. 5-stage pipeline Built-in high-speed memory DSP function: A 32-bit multiplication and accumulation operation can be executed with one clock. Optimized design using a low power dissipation library Standby function that stops the operation of the processor core Independency of the entry address Automatic generation of factor-specific vector addresses Automatic update of interrupt mask levels
Product name TMP19A43CZXBG TMP19A43CDXBG TMP19A43FZXBG TMP19A43FDXBG Built-in ROM 384Kbyte 512Kbyte 384Kbyte (Flash) 512Kbyte (Flash) Built-in RAM 20Kbyte 24Kbyte 20Kbyte 24Kbyte
Low power dissipation
3)
High-speed interrupt response suitable for real-time control * * *
(2) Internal program memory and data memory
* * *
ROM correction function: 1 word x 8 blocks, 8 words x 4 blocks Expandable to 16 megabytes (for both programs and data) External data bus: Separate bus/multiplexed bus Chip select/wait controller Activated by an interrupt or software Data to be transferred to internal memory, internal I/O, external memory, and external I/O : 16 channels 16-bit interval timer mode 16-bit event counter mode 16-bit PPG output (every 4 channels, synchronous outputs are possible) Input capture function 2-phase pulse input counter function (4 channels assigned to perform this function): Multiplicationby-4 mode : Coexistence of 8- and 16-bit widths is possible. : 4 channels : 8 channels (2 interrupt factors)
(3) External memory expansion
(4) DMA controller * * * * * * *
(5) 16-bit timer
TMP19A43 (rev2.0) 1-2
Overview and Features
TMP19A43
(6) 32-bit timer * * * 32-bit input capture register 32-bit compare register 32-bit time base timer : 4 channels : 8 channels : 1 channel : 1 channel : 3 channels : 3 channels
(7) Clock timer (8) General-purpose serial interface * * (9) High-speed serial interface
Selectable between the UART mode and the synchronization mode Selectable between the UART mode and the high-speed synchronization mode (maximum speed: 10 Mbps in the high-speed synchronization mode @40MHz) : 1 channel
2
(10) Serial bus interface * * * * * * * (11) 10-bit A/D converter (with S/H) Fixed channel/scan mode Single/repeat mode Top-priority conversion mode Timer monitor function Conversion time 1.15 sec(@ 40MHz)
Selectable between the I C bus mode and the clock synchronization mode : 16 channels Start by an external trigger, and the internal timer activated by a trigger
(12) 8-bit D/A converter (13) Watchdog timer (14) Interrupt function * * *
: 2 channels : 1 channel
CPU: 2 factors ...................software interrupt instruction Internal: 46 factors.............The order of precedence can be set over 7 levels (except the watchdog timer interrupt). External: 48 factors ..........The order of precedence can be set over 7 levels. Because 32 factors are associated with KWUP, the number of interrupt factors is one.
(15) Input and output ports ...............143 terminals (16) Standby function * * * * Three standby modes (IDLE, SLEEP, STOP) Built-in PLL (multiplication by 4) Clock gear function: The high-speed clock can be divided into 3/4, 1/2, 1/4 or 1/8. Sub-clock: SLOW and SLEEP modes (32.768 kHz) (17) Clock generator
(18) Endian: Bi-endian (big-endian/little-endian) (19) Maximum operating frequency * * * * 40 MHz (PLL multiplication) Core: I/O and ADC: DAC: 1.35 V to 1.65 V 2.7 V to 3.6 V 2.3 V to 2.7 V (20) Operating voltage range
(21) Package P-FBGA193 (12 mm x 12 mm, 0.65 mm pitch)
TMP19A43 (rev2.0) 1-3
Overview and Features
TMP19A43
TX19 Processor Core TX19A CPU MAC 512K/384byte Flash/MASK ROM correction Clock generator (CG) External bus interface Clock timer (1ch) EJTAG 24K/20Kbyte RAM
DMAC (8ch) INTC
HSIO/UART 0 to 2 (3ch) I/O bus interface
16-bit TMRB 0 to 15 (16ch) 32-bit TMRC TBT (1ch) 32-bit TMRC Input Capture 0 to 3 (4ch) 32-bit TMRC Compare 0 to 7 (8ch) 10-bit ADC (16ch) 8-bit DAC (2ch)
PORT0 to PORT6 (also function as external bus I/F) PORT7 to PORT8 (also function to receive ADC inputs) PORT9 to PORTH (also function as functional pins) SIO/UART 0 to 2 (3ch) I2C/SIO (1ch)
WDT KWUP (32ch)
Fig. 1-1 TMP19A43 Block Diagram
TMP19A43 (rev2.0) 1-4
Overview and Features
TMP19A43
2.
2.1
Pin Layout and Pin Functions
This section shows the pin layout of TMP19A43 and describes the names and functions of input and output pins.
Pin Layout (Top view)
Fig. 2-1 Pin Layout Diagram (P-FBGA193) shows the pin layout of TMP19A43.
A1 B1 C1 D1 E1 F1 G1 H1 J1 K1 L1 M1 N1 P1 R1 T1 U1
A2 B2 C2 D2 E2 F2 G2 H2 J2 K2 L2 M2 N2 P2 R2 T2 U2
A3 B3
A4 B4 D4 E4 F4 G4 H4 J4 K4 L4 M4 N4 P4
A5 B5 D5 E5 F5 G5 H5 J5 K5 L5 M5 N5 P5 T5 U5
A6 B6 D6 E6 F6
A7 B7 D7 E7
A8 B8 D8 E8
A9 B9
A10 A11 A12 A13 A14 A15 A16 A17 B10 B11 B12 B13 B14 B15 B16 B17 C16 C17 D16 D17 E16 E17 F16 F17 G16 H16 J16 K16 L16 M16 G17 H17 J17 K17 L17 M17 N17 P17 R17 T17 U17
D9 D10 D11 D12 D13 D14 E9 E10 E11 E12 E13 E14 F13 F14 G13 H13 J13 K13 L13 M13 G14 H14 J14 K14 L14 M14
N6 P6 T6 U6
N7 P7 T7 U7
N8 P8 T8 U8
N9 N10 N11 N12 N13 N14 P9 P10 P11 P12 P13 P14
T3 U3
T4 U4
N16 P16 R16 T9 T10 T11 T12 T13 T14 T15 T16 U9 U10 U11 U12 U13 U14 U15 U16
Fig. 2-1 Pin Layout Diagram (P-FBGA193)
TMP19A43 (rev2.0) 2-1
Pin Layout and Pin Functions
TMP19A43
2.2
Pin Numbers and Names
Table 2-1 shows the pin numbers and names of TMP19A43.
Table 2-1 Pin numbers and names
Pin No. A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 B1 B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B12 B13 B14 B15 B16 B17 C1 C2 C16 C17 D1 Pin Name DVSS P81/AN9/KEY05 P83/AN11/KEY07 P85/AN13/INT7 P87/AN15/INT9 DA0 CVREF0 DA1 CVREF1 PD2/HSCLK2/HCTS2 PE2/KEY10 PE5/KEY13 PE7/KEY15 X1 X2 CVCCH CVSS PF0/KEY16/DREQ0 P80/AN8/KEY04 P82/AN10/KEY06 P84/AN12/INT6 P86/AN14/INT8 P75/AN5/KEY01 P77/AN7/KEY03 PD6/KEY31/AFTRG PD4/TBCOUT PD1/HRXD2 PE1/KEY09 PE4/KEY12 PE6/KEY14 PA5/INT5/TB8IN1 PA6/ TB2IN0 PA7/TB2IN1 CVCCL PF2/KEY18/DREQ4 PF1/KEY17/DACK0 PA4/INT4/TB8IN0 XT2 PF4/KEY20/TCOUT4 Pin No. D2 D4 D5 D6 D7 D8 D9 D10 Pin Name PF3/KEY19/DACK4 P71/AN1 P73/AN3 P74/AN4/KEY00 P76/AN6/KEY02 PD5/TBDOUT PD3/TBBOUT PD0/HTXD2 Pin No. G2 G4 G5 G13 G14 G16 G17 H1 Pin Name P95/SCLK2/CTS2 P94/RXD2 P93/TXD2 PH1/TPC1/TPD1 PH7/TPC7/TPD7 PCST4 DCLK PC1/TCOUT0 PC0/TBTIN/KEY30 P97/TBAOUT DVCC3 PH2/TPC2/TPD2 TRST TMS EJE PC4/TCOUT3 PC3/TCOUT2 PC2/TCOUT1 DVCC15 PH3/TPC3/TPD3 DINT TDO DVSS PC7/SCK PC6/SI/SCL PC5/SO/SDA DVSS DVCC15 TOVR/TSTA TDI TCK PB2/HTXD0 PB1/TB3IN1 PB0/TB3IN0 TEST1 DVSS PG0/TPD0 PG1/TPD1 PG2/TPD2 Pin No. Pin Name Pin No. Pin Name P33/WAIT/RDY P45/BUSMD P46/ENDIAN P37/ALE/TC3IN
P34/BUSRQ/TBEOUT
M1 PB5/HTXD1 R2 M2 PB4/HSCLK0/HCTS0 R16 M4 PB3/HRXD0 R17 M5 TEST4 T1 M13 FVCC3 T2 M14 PG3/TPD3 T3 M16 PG4/TPD4 T4 M17 PG5/TPD2 T5
P30/RD P02/D2/AD2 P06/D6/AD6
D11 PE0/KEY8 H2 D12 PE3/KEY11 H4 D13 PA2/INT2/TB7IN0 H5 D14 PH4/TPC4/TPD4 H13 D16 PA3/INT3/TB7IN1 H14 D17 XT1 H16 E1 PF6/KEY22/TCOUT6 H17 E2 PF5/KEY21/TCOUT5 J1 E4 P70/AN0 J2 E5 P72/AN2 J4 E6 VREFH J5 E7 AVSS J13 E8 DAVCC J14 E9 DAVREF J16 E10 DAGND J17 E11 DVCC3 K1 E12 PA0/INT0/TB6IN0 K2 E13 PA1/INT1/TB6IN1 K4 E14 PH5/TPC5/TPD5 K5 E16 PCST0 K13 E17 PCST1 K14 F1 PF7/KEY23/TCOUT7 K16 F2 P92/TB8OUT K17 F4 P91/TB7OUT L1 F5 P90/TB6OUT L2 F6 AVCC3 L4 F13 PH0/TPC0/TPD0 L5 F14 PH6/TPC6/TPD6 L13 F16 PCST2 L14 F17 PCST3 L16 G1 P96/TB9OUT L17
N1 PB7/HSCLK1/HCTS1 T6 P12/D10/AD10/A10 N2 PB6/HRXD1 T7 P16/D14/AD14/A14 N4 P00/D0/AD0 T8 P21/A17/A1/TB0IN1 N5 P04/D4/AD4 T9 P24/A20/A4/TB4IN0 N6 P10/D8/AD8/A8 T10 P26/A22/A6/TB5IN0 N7 P14/D12/AD12/A12 T11 P52/A2/INTE N8 FVCC3 T12 P56/A6/TB2OUT/KEY28 N9 DVSS T13 P62/A10/SCLK0/CTS0 N10 DVCC15 T14 P66/A14/TB4OUT N11 P50/A0/INTC T15 P40/CS0/KEY24 N12 P54/A4/TB0OUT T16 P42/CS2/KEY26 N13 P60/A8/TXD0 T17 P44/SCOUT N14 P64/A12/RXD1/INTB U1 TEST2 N16 PG6/TPD6 U2 P35/BUSAK/TC1IN N17 PG7/TPD7 U3 P31/WR P1 BOOT U4 P03/D3/AD3 P2 P32/HWR/TC0IN U5 P07/D7/AD7 P4 P01/D1/AD1 U6 P13/D11/AD11/A11 P5 P05/D5/AD5 U7 P17/D15/AD15/A15 P6 P11/D9/AD9/A9 U8 P22/A18/A2/TB1IN0 P7 P15/D13/AD13/A13 U9 P25/A21/A5/TB4IN1 P8 P20/A16/A0/TB0IN0 U10 P27/A23/A7/TB5IN1 P9 P23/A19/A3/TB1IN1 U11 P53/A3/INTF P10 TEST0 U12 P57/A7/TB3OUT/KEY29 P11 P51/A1/INTD U13 P63/A11/TXD1 P12 P55/A5/TB1OUT U14 P67/A15/TB5OUT P13 P61/A9/RXD0/INTA U15 P41/CS1/KEY25 P14 P65/A13/SCLK1/CTS1 U16 P43/CS3/KEY27 P16 P47/TBFOUT U17 TEST3 P17 RESET R1 P36/RW/TC2IN
TMP19A43 (rev2.0) 2-2
Pin Layout and Pin Functions
TMP19A43
2.3
Pin Names and Functions
Table 2-2 through Table 2-7 show the names and functions of input and output pins. Table 2-2 Pin Names and Functions (1 of 6)
Pin name
P00-P07 D0-D7 AD0-D7 P10-P17 D8-D15 AD8-AD15 A8-A15 P20-P27 A16-A23 A0-A7
TB0IN0,TB0IN1 TB1IN0,TB1IN1 TB4IN0,TB4IN1 TB5IN0,TB5IN1
Number of pins 8
Input or output
Input/output Input/output Input/output Input/output Input/output Input/output Output Input/output Output Output Input Input Input Input Output
Output
Function
Port 0: Input/output port (with pull-up) that allows input/output to be set in units of bits Data (lower): Data bus 0 to 7 (separate bus mode) Address data (lower): Address data bus 0 to 7 (multiplexed bus mode) Port 1: Input/output port (with pull-up) that allows input/output to be set in units of bits Data (upper): Data bus 8 to 15 (separate bus mode) Address data (upper): Address data bus 8 to 15 (multiplexed bus mode) Address: Address bus 8 to 15 (multiplexed bus mode) Port 2: Input/output port (with pull-up) that allows input/output to be set in units of bits Address: Address bus 15 to 23 (separate bus mode) Address: Address bus 0 to 7 (multiplexed bus mode) 16-bit timer 0 input 0,1: For inputting the count/capture trigger of a 16-bit timer 0 16-bit timer 1 input 0,1: For inputting the count/capture trigger of a 16-bit timer 1 16-bit timer 4 input 0,1: For inputting the count/capture trigger of a 16-bit timer 4 16-bit timer 5 input 0,1: For inputting the count/capture trigger of a 16-bit timer 5 Port 30: Port used exclusively for output
Read: Strobe signal for reading external memory Port 31: Port used exclusively for output
Write: Strobe signal for writing data of D0 to D7 pins Port 32: Input/output port (with pull-up) Write upper-pin data: Strobe signal for writing data of D8 to D15 pins For inputting the capture trigger for 32-bit timer Port 33: Input/output port (with pull-up)
Wait: Pin for requesting CPU to put a bus in a wait state Ready: Pin for notifying CPU that a bus is ready Port 34: Input/output port (with pull-up) Bus request: Signal requesting CPU to allow an external master to take the bus control authority 16-bit timer E output: Pin for outputting 16-bit timer E Port 35: Input/output port (with pull-up) Bus acknowledge: Signal notifying that CPU has released the bus control authority in response to BUSRQ For inputting the capture trigger for 32-bit timer Port 36: Input/output port (with pull-up) Read/write: "1" shows a read cycle or a dummy cycle. "0" shows a write cycle. For inputting the capture trigger for 32-bit timer Port 37: Input/output port (with pull-up) Address latch enable (address latch is enabled only if access to external memory is taking place) For inputting the capture trigger for 32-bit timer Port 40: Input/output port (with pull-up)
8
8
P30
1
RD P31
WR P32 HWR TC0IN P33
WAIT RDY P34
BUSRQ
TBEOUT P35
1
Output
Output
1
Input/output Output Input Input/output
Input Input Input/output Input Output Input/output Output Input Input/output Output Input Input/output Output Input Input/output
1
1
1
BUSAK
TC1IN P36
R/W TC2IN P37
1
1
ALE TC3IN P40
1
CS0
KEY24 P41 1
Output Input Input/output Output Input 1 Input/output
Chip select 0: "0" is output if the address is in a designated address area. KEY on wake up input 24: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter Port 41: Input/output port (with pull-up) Chip select 1: "0" is output if the address is in a designated address area. KEY on wake up input 25: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter Port 42: Input/output port (with pull-up)
CS1
KEY25 P42
CS2
KEY26
Output Input
Chip select 2: "0" is output if the address is in a designated address area. KEY on wake up input 26: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter
TMP19A43 (rev2.0) 2-3
Pin Layout and Pin Functions
TMP19A43
Table 2-3 Pin Names and Functions (2 of 6)
Pin name
P43 Number of pins 1
Input or output
Input/output Port 43: Input/output port (with pull-up)
Function
CS3
KEY27 P44 SCOUT P45 BUSMD 1
Output Input Input/output Output Input/output Input
Chip select 3: "0" is output if the address is in a designated address area. KEY on wake up input 27: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter Port 44: Input/output port (with pull-up) System clock output: Selectable between high- and low-speed clock outputs, as in the case of CPU Port 45: Input/output port (with pull-up) Pin for setting an external bus mode: This pin functions as a multiplexed bus by sampling the "H (DVCC3) level" at the rise of a reset signal. It also functions as a separate bus by sampling "L" at the rise of a reset signal. When performing a reset operation, pull it up or down according to a bus mode to be used. Input with Schmitt trigger. (After a reset operation is performed, it can be used as a port.) Port 46: Input/output port (with pull-up) This pin is used to set a mode. It performs a big-endian operation by sampling the "H (DVCC3) level" at the rise of a reset signal, and performs a little-endian operation by sampling "L" at the rise of a reset signal. When performing a reset operation, pull it up or down according to the type of endian to be used. (After a reset operation is performed, it can be used as a port.) Input with Schmitt trigger Port 47: Input/output port (with pull-up) 16-bit timer F output: Pin for outputting a 16-bit timer F Port 5: Input/output port (with pull-up) that allows input/output to be set in units of bits Address: Address buses 0 to 3 (separate bus mode) Interrupt request pins C to F: Selectable between "H" level, "L" level, rising edge, and falling edge Input pin with Schmitt trigger with Noise filter Port 5: Input/output port (with pull-up) that allows input/output to be set in units of bits Address: Address buses 4 and 5 (separate bus mode) 16-bit timer 0 output: Pin for outputting a 16-bit timer 0 16-bit timer 1 output: Pin for outputting a 16-bit timer 1 Port 5: Input/output port (with pull-up) that allows input/output to be set in units of bits Address: Address buses 6 and 7 (separate bus mode) 16-bit timer 2 output: Pin for outputting a 16-bit timer 2 16-bit timer 3 output: Pin for outputting a 16-bit timer 3 KEY on wake up input 28 and 29: (Dynamic pull up is selectable) Input pin with Schmitt trigger with Noise filter Port 60: Input/output port (with pull-up) Address: Address bus 8 (separate bus mode) Sending serial data 0: Open drain output pin depending on the program used Port 61: Input/output port (with pull-up) Address: Address bus 9 (separate bus mode) Receiving serial data 0 Interrupt request pin A: Selectable between "H" level, "L" level, rising edge, falling edge, and both rising and falling edges. Input pin with Schmitt trigger with Noise filter Port 62: Input/output port (with pull-up) Address: Address bus 10 (separate bus mode) Serial clock input/output 0 Handshake input pin Open drain output pin depending on the program used Port 63: Input/output port (with pull-up) Address: Address bus 11 (separate bus mode) Sending serial data 1: Open drain output pin depending on the program used Port 64: Input/output port (with pull-up) Address: Address bus 12 (separate bus mode) Receiving serial data 1 Interrupt request pin B: Selectable between "H" level, "L" level, rising edge, falling edge, and both rising and falling edges. Input pin with Schmitt trigger with Noise filter
1
P46 ENDIAN
1
Input/output Input
P47 TBFOUT P50-P53 A0-A3 INTC-INTF
1 4
Input/output Output Input/output Output Input
P54,P55 A4,A5 TB0OUT TB1OUT P56,P57 A6,A7 TB2OUT TB3OUT KEY28,KEY29 P60 A8 TXD0 P61 A9 RXD0 INTA
2
2
Input/output Output Output Output Input/output Output Output Output Input Input/output Output Output Input/output Output Input Input
1
1
P62 A10 SCLK0 CTS0 P63 A11 TXD1 P64 A12 RXD1 INTB
1
Input/output Output Input/output Input Input/output Output Output Input/output Output Input Input
1
1
TMP19A43 (rev2.0) 2-4
Pin Layout and Pin Functions
TMP19A43
Table 2-4 Pin Names and Functions (3 of 6)
Pin name
P65 A13 SCLK1 CTS1 P66,P67 A14,A15 TB4OUT TB5OUT P70-P73 AIN0-AIN3 P74-P77 AIN4-AIN7
KEY00-KEY03
Number of pins 1
Input or output
Input/output Output Input/output Input Input/output Output Output Output Input Input Input Input Input Input Input Input Input Input
Function
Port 65: Input/output port (with pull-up) Address: Address bus 13 (separate bus mode) Serial clock input/output 1 Handshake input pin. Open drain output pin depending on the program used Port 6: Input/output port (with pull-up) that allows input/output to be set in units of bits Address: Address buses 14 and 15 (separate bus mode) 16-bit timer 4 output: Pin for outputting a 16-bit timer 4 16-bit timer 5 output: Pin for outputting a 16-bit timer 5 Port 7: Port used exclusively for input (with pull-up) Analog input: Input from A/D converter Port 7: Port used exclusively for input (with pull-up) Analog input: Input from A/D converter KEY on wake up input 00 to 03: (Dynamic pull up is selectable) Input pin with Schmitt trigger with Noise filter Port 8: Port used exclusively for input (with pull-up) Analog input: Input from A/D converter KEY on wake up input 04 to 07: (Dynamic pull up is selectable) Input pin with Schmitt trigger with Noise filter Port 8: Port used exclusively for input (with pull-up) Analog input: Input from A/D converter Interrupt request pins 6 to 9: Selectable between "H" level, "L" level, rising edge, falling edge, and both rising and falling edges. Input pin with Schmitt trigger with Noise filter Port 9: Input/output port (with pull-up) that allows input/output to be set in units of bits 16-bit timer 6 output: Pin for outputting a 16-bit timer 6 16-bit timer 7 output: Pin for outputting a 16-bit timer 7 16-bit timer 8 output: Pin for outputting a 16-bit timer 8 Port 93: Input/output port (with pull-up) Sending serial data 2: Open drain output pin depending on the program used Port 94: Input/output port (with pull-up) Receiving serial data 2 Port 95: Input/output port (with pull-up) Serial clock input/output 2 Handshake input pin Open drain output pin depending on the program used Ports 96 and 97: Input/output port (with pull-up) that allows input/output to be set in units of bits 16-bit timer 9 output: Pin for outputting a 16-bit timer 9 16-bit timer A output: Pin for outputting a 16-bit timer A Port A0: Input/output port (with pull-up) 16-bit timer 6 input 0: For inputting the capture trigger of a 16-bit timer 6 Interrupt request pin 0: Selectable between "H" level, "L" level, rising edge, falling edge, and both rising and falling edges. Input pin with Schmitt trigger with Noise filter Port A1: Input/output port (with pull-up) 16-bit timer 6 input 1: For inputting the capture trigger of a 16-bit timer 6 Interrupt request pin 1: Selectable between "H" level, "L" level, rising edge, falling edge, and both rising and falling edges Input pin with Schmitt trigger with Noise filter Port A2: Input/output port (with pull-up) 16-bit timer 7 input 0: For inputting the capture trigger of a 16-bit timer 7 Interrupt request pin 0: Selectable "H" level, "L" level, rising edge, falling edge, and both rising and falling edges. Input pin with Schmitt trigger with Noise filter Port A3: Input/output port (with pull-up) 16-bit timer 7 input 1: For inputting the capture trigger of a 16-bit timer 7 Interrupt request pin 1: Selectable between "H" level, "L" level, rising edge, falling edge, and both rising and falling edges. Input pin with Schmitt trigger with Noise filter
2
4 4
P80-P83 AIN8-AIN11
KEY04-KEY07
4
P84-P87 AIN12-AIN15 INT6-9
4
P90-P92 TB6OUT TB7OUT TB8OUT P93 TXD2 P94 RXD2 P95 SCLK2 CTS2 P96,P97 TB9OUT TBAOUT PA0 TB6IN0 INT0
3
1 1 1
Input/output Output Output Output Input/output Output Input/output Input Input/output Input/output Input Input/output Output Output Input/output Input Input
2
1
PA1 TB6IN1 INT1
1
Input/output Input Input
PA2 TB7IN0 INT2
1
Input/output Input Input
PA3 TB7IN1 INT3
1
Input/output Input Input
TMP19A43 (rev2.0) 2-5
Pin Layout and Pin Functions
TMP19A43
Table 2-5 Pin Names and Functions (4 of 6)
Pin name
PA4 TB8IN0 INT4 Number of pins 1
Input or output
Input/output Input Input
Function
Port A4: Input/output port (with pull-up) 16-bit timer 8 input 0: For inputting the capture trigger of a 16-bit timer 8 Interrupt request pin 0: Selectable between "H" level, "L" level, rising edge, falling edge, and both rising and falling edges Input pin with Schmitt trigger with Noise filter Port A5: Input/output port (with pull-up) 16-bit timer 8 input 1: For inputting the capture trigger of a 16-bit timer 8 Interrupt request pin 1: Selectable between "H" level, "L" level, rising edge, falling edge, and both rising and falling edges Input pin with Schmitt trigger with Noise filter Port A6: Input/output port (with pull-up) 16-bit timer 2 input 0: For inputting the capture trigger of a 16-bit timer 2 Port A7: Input/output port (with pull-up) 16-bit timer 2 input 1: For inputting the capture trigger of a 16-bit timer 2 Port B0: Input/output port (with pull-up) 16-bit timer 3 input 0: For inputting the capture trigger of a 16-bit timer 3 Port B1: Input/output port (with pull-up) 16-bit timer 3 input 1: For inputting the capture trigger of a 16-bit timer 3 Port B2: Input/output port (with pull-up) Sending serial data 0 at high speeds: Open drain output pin depending on the program used Port B3: Input/output port (with pull-up) Receiving serial data 0 at high speeds Port B4: Input/output port (with pull-up) High-speed serial clock input/output 0 Handshake input pin: Open drain output pin depending on the program used Port B5: Input/output port (with pull-up) Sending serial data 1 at high speeds: Open drain output pin depending on the program used Port B6: Input/output port (with pull-up) Receiving serial data 1 at high speeds Port B7: Input/output port (with pull-up) High-speed serial clock input/output 1 Handshake input pin: Open drain output pin depending on the program used Port C0: Input/output port (with pull-up) 32-bit time base timer input: For inputting a 32-bit time base timer KEY on wake up input 30: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter Ports C1 to C4: Input/output ports (with pull-up) that allow input/output to be set in units of bits Outputting 32-bit timer if the result of a comparison is a match Port C5: Input/output port (with pull-up) Pin for sending data if the serial bus interface operates in the SIO mode Pin for sending and receiving data if the serial bus interface operates in the I2C mode Open drain output pin depending on the program used Input with Schmitt trigger Port C6: Input/output port (with pull-up) Pin for receiving data if the serial bus interface operates in the SIO mode Pin for inputting and outputting a clock if the serial bus interface operates in the I2C mode Open drain output pin depending on the program used Input with Schmitt trigger Port C7: Input/output port (with pull-up) Pin for inputting and outputting a clock if the serial bus interface operates in the SIO mode Open drain output pin depending on the program used
PA5 TB8IN1 INT5
1
Input/output Input Input
PA6 TB2IN0 PA7 TB2IN1 PB0 TB3IN0 PB1 TB3IN1 PB2 HTXD0 PB3 HRXD0 PB4 HSCLK0 HCTS0 PB5 HTXD1 PB6 HRXD1 PB7 HSCLK1 HCTS1 PC0 TBTIN KEY30 PC1-PC4 TCOUT0TCOUT3 PC5 SO SDA
1
1 1 1 1 1
Input/output Input Input/output Input Input/output Input Input/output Input Input/output Output Input/output Input Input/output Input/output Input Input/output Output Input/output Input Input/output Input/output Input Input/output Input
1 1 1
1
4
Input/output Output
1
Input/output Output Input/output
PC6 SI SCL
1
Input/output Input Input/output
PC7 SCK
1
Input/output Input/output
TMP19A43 (rev2.0) 2-6
Pin Layout and Pin Functions
TMP19A43
Table 2-6 Pin Names and Functions (5 of 6)
Pin name
PD0 HTXD2 PD1 HRXD2 PD2 HSCLK2 HCTS2 PD3-PD5 TBBOUTTBDOUT PD6 ADTRG KEY31 PE0-PE7
KEY08-KEY15
Number of pins 1 1 1
Input or output
Input/output Output Input/output Input Input/output Input/output Input Input/output Output
Function
Port D0: Input/output port (with pull-up) Sending serial data 2 at high speeds: Open drain output pin depending on the program used Port D1: Input/output port (with pull-up) Receiving serial data 2 at high speeds Port D2: Input/output port (with pull-up) High-speed serial clock input/output 2 Handshake input pin: Open drain output pin depending on the program used Ports D3 to D5: Input/output ports (with pull-up) that allow input/output to be set in units of bits 16-bit timers B, C and D outputs: Pin for outputting 16-bit timers B, C and D Port D6: Input/output port (with pull-up) that allows input/output to be set in units of bits Pin (with Schmitt trigger) for starting A/D trigger or A/D converter from an external source KEY on wake up input 31: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter Port E: Input/output port (with pull-up) that allows input/output to be set in units of bits KEY on wake up input 08 to 15: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter Port F: Input/output port (with pull-up) that allows input/output to be set in units of bits DMA request signals 0 and 4: For inputting the request to transfer data by DMA from an external I/O device to DMAC0 or DMAC4 KEY on wake up input 16 to 19: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter Port F: Input/output port (with pull-up) that allows input/output to be set in units of bits DMA acknowledge signals 0 and 4: Signal showing that DREQ0 and DREQ4 have acknowledged a DMA transfer request KEY on wake up input 16 to 19: (Dynamic pull up is selectable) Input with Schmitt trigger with Noise filter Port F: Input/output port (with pull-up) that allows input/output to be set in units of bits KEY on wake up input 20 to 23: (Dynamic pull up is selectable) Input with Schmitt trigger Outputting 32-bit timer if the result of a comparison is a match with Noise filter Port G: Input/output port (with pull-up) that allows input/output to be set in units of bits Outputting trace data from the data access address: Signal for DSU-ICE Port H: Input/output port (with pull-up) that allows input/output to be set in units of bits Outputting trace data from the program counter: Signal for DSU-ICE Outputting trace data from the data access address: Signal for DSU-ICE Debug clock: Signal for DSU-ICE DSU-ICE enable: Signal for DSU-ICE (with Schmitt trigger) (with pull-up) with Noise filter PC trace status: Signal for DSU-ICE Debug interrupt: Signal for DSU-ICE (input with Schmitt trigger and pull-up) with Noise filter Outputting the status of PD data overflow status: Signal for DSU-ICE Test clock input: Signal for testing DSU-ICE (with Schmitt trigger and pull-up) with Noise filter Test mode select input: Signal for testing DSU-ICE (with Schmitt trigger and pull-up) Test data input E: Signal for testing JTAG (with Schmitt trigger and pull-up) Test data output: Signal for testing DSU-ICE Test reset input: Signal for testing DSU-ICE (with Schmitt trigger and pull-down) with Noise filter Reset: Initializing LSI (with pull-up) Input with Schmitt trigger with Noise filter Pin for connecting a high-speed oscillator (X1: Input with Schmitt trigger) Pin for connecting a low-speed oscillator (XT1: Input with Schmitt trigger)
3
1
Input/output Input Input Input/output Input Input/output Input Input
8
PF0,PF2 DREQ0,4
KEY16,KEY18
2
PF1,PF3 DACK0,4
KEY17,KEY19
2
Input/output Output Input
PF4-PF7
KEY20-KEY23 TCOUT4TCOUT7
4
Input/output Input Output Input/output Output Input/output Output Output Output Input Output Input Output Input Input Input Output Input Input Input/output Input/output
PG0-PG7 TPD0-TPD7 PH0-PH7 TPC0-TPC7 TPD0-TPD7 DCLK EJE PCST4-0 DINT TOVR/TSR TCK TMS TDI TDO TRST
8 8
1 1 4 1 1 1 1 1 1 1 1 2 2
RESET
X1/X2 XT1/XT2
TMP19A43 (rev2.0) 2-7
Pin Layout and Pin Functions
TMP19A43
Table 2-7 Pin Names and Functions (6 of 6)
Pin name
BOOT Number of pins 1
Input or output
Input
Function
Pin for setting a single boot mode: This pin goes into single boot mode by sampling "L" at the rise of a reset signal. It is used to overwrite internal flash memory. By sampling "H (DVCC3) level" at the rise of a reset signal, it performs a normal operation. This pin should be pulled up under normal operating conditions. Pull it up when resetting. (With pull-up) Pin (H) for supplying the A/D converter with a reference power supply Connect this pin to AVCC3 if the A/D converter is not used. Pin for supplying the A/D converter with a power supply. Connect it to a power supply even if the A/D converter is not used. A/D converter GND pin (0 V). Connect this pin to GND even if the A/D converter is not used. Pin (L) for supplying the A/D converter with a reference power supply TEST pin: To be fixed to DVCC3 (with Schmitt trigger) TEST pin: To be fixed to DVCC3 TEST pin: Set to OPEN. TEST pin: Set to OPEN. TEST pin: Set to OPEN. Pin for supplying a high-frequency oscillator with power: 1.5 V power supply Pin for supplying a low-frequency oscillator with power: 3 V power supply Oscillator GND pin (0 V) Power supply pin: 1.5 V power supply Power supply pin: 3 V power supply Power supply pin: GND pin (0 V) Power supply pin for the D/A converter: 2.5 V power supply If the D/A converter is not used, connect (fix) this pin to GND. Reference power supply pin for the D/A converter If the D/A converter is not used, connect (fix) this pin to GND. GND pin (0 V) for the D/A converter Connect this pin to GND even if the D/A converter is not used. Pin for connecting a stabilizing capacitor to the D/A converter Pin for connecting a stabilizing capacitor to the D/A converter D/A converter 0 output pin D/A converter 1 output pin
VREFH AVCC3 AVSS TEST0 TEST1 TEST2 TEST3 TEST4 CVCCH CVCCL CVSS DVCC15 DVCC3 DVSS DAVCC CVREF DAGND CVREF0 CVREF1 DA0 DA1
1 1 1 1 1 1 1 1 1 1 1 3 4 5 1 1 1 1 1 1 1
Input - - Input Input Input Input Input - - - - - - - - - - - Output Output
TMP19A43 (rev2.0) 2-8
Pin Layout and Pin Functions
TMP19A43
2.4
Pin Names and Power Supply Pins
Table 2-8 Pin Names and Power Supplies Pin name P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 PA PB PC PD PE PF PG PH Power supply DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 AVCC3 AVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 Pin name PCST4-0 DCLK EJE TRST TDI TDO TMS TCK DINT TOVR/TSTA BUSMD BOOT X1, X2 XT1, XT2 RESET DA0,1 Power supply DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 DVCC3 CVCCH CVCCL DVCC3 DAVCC
2.5
Pin Numbers and Power Supply Pins
Table 2-9 Pin Numbers and Power Supplies
Power supply DVCC15 DVCC3 AVCC3 FVCC3 CVCCH CVCCL DAVCC
Pin number J5, K13, N10 E11, H5 F6 M13, N8 A16 B17 E8
Voltage range 1.35 V to 1.65 V 1.65 V to 3.6 V 2.7 V to 3.6 V 2.7 V to 3.6 V 1.35 V to 1.65 V 2.7 V to 3.6 V 2.3 V to 2.7 V
TMP19A43 (rev2.0) 2-9
TMP19A43
3.
Processor Core
The TMP19A43 has a high-performance 32-bit processor core (TX19A processor core). For information on the operations of this processor core, please refer to the "TX19A Family Architecture." This chapter describes the functions unique to the TMP19A43 that are not explained in that document.
3.1
Reset Operation
To reset the device, ensure that the power supply voltage is in the operating voltage range, the oscillation of the internal high-frequency oscillator has stabilized at the specified frequency and that the RESET input has been "0" for at least 12 system clocks (2.4 s during external 10 MHz operation). Note that the PLL multiplication clock is quadrupled and the clock gear is initialized to the 1/8 mode during the reset period. When the reset request is authorized, the system control coprocessor (CP0) register of the TX19A processor core is initialized. For further details, please refer to the chapter about architecture. After the reset exception handling is executed, the program branches off to the exception handler. The address to which the program branches off to (address where exception handling starts) is called an exception vector address. This exception vector address of a reset exception (for example, nonmaskable interrupt) is 0xBFC0_0000H (virtual address). The register of the internal I/O is initialized. The port pin (including the pin that can also be used by the internal I/O) is set to a general-purpose input or output port mode.
(Note 1) Set the RESET pin to "0" before turning the power on. Perform the reset after the power supply voltage has stabilized sufficiently within the operating range. (Note 2) After turning the power on, make sure that the power supply voltage and oscillation have stabilized, wait for 500 s or longer, and perform the reset. (Note 3) In the FLASH program, the reset period of 0.5 uS or longer is required independently of the system clock. (Note 4) The reset operation can alter the internal RAM state, but does not alter data in the backup RAM.
TMP19A43 (rev2.0) 3-1
Processor Core
TMP19A43
4.
Memory Map
Fig. 4-1 shows the memory map of the TMP19A43FDXBG/TMP19A43CDXBG.
Virtual address 0xFFFF FFFF 0xFF00 0000 Kseg2 (1 GB) 0XBFC7 0xBFC0 0000 0xA000 0000 0x8000 0000 16 MB reserved Internal ROM area 0x4007 FFFF projection 0x4000 0000 Inaccessible Internal ROM 0x0007 FFFF 0x0000 0000 512 MB 0x1FC7 FFFF 0x1FC0 0000 Kseg1 (cash disabled) Kuseg (2 GB) Kseg0 (cash enabled)
Reserved for debugging (2 MB)
Physical address 16 MB reserved Kseg2 (cash enabled) 16 MB reserved Internal I/O 0xFFFF E000 Built-in RAM area 0xFFFF DFFF (24 KB) 0xFFFF 8000 Inaccessible
16 MB reserved
0xFF3F FFFF 0xFF20 0000 0xFF00 0000 0x1FC7 FFFF
Inaccessible
Kuseg (cash enabled)
User program area Maskable interrupt area Exception vector area 0x1FC0 0400
0x1FC0 0000
Fig. 4-1 Memory Map Fig. 4-2 shows the memory map of the TMP19A43FZXBG/TMP19A43CZXBG.
Virtual address 0xFFFF FFFF 0xFF00 0000 Kseg2 (1 GB) 0XBFC5 FFFF 0xBFC0 0000 0xA000 0000 0x8000 0000 16 MB reserved Internal ROM area 0x4005 FFFF projection 0x4000 0000 Inaccessible Internal ROM 0x0005 FFFF 0x0000 0000 384 MB 0x1FC5 FFFF 0x1FC0 0000 Kseg1 (cash disabled) Kuseg (2 GB) Kseg0 (cash enabled)
Reserved for debugging (2 MB)
Physical address 16 MB reserved Kseg2 (cash enabled) 16 MB reserved Internal I/O 0xFFFF E000 Built-in RAM area 0xFFFF DFFF (20 KB) 0xFFFF 9000 Inaccessible
16 MB reserved
0xFF3F FFFF 0xFF20 0000 0xFF00 0000 0x1FC5 FFFF
Inaccessible
Kuseg (cash enabled)
User program area Maskable interrupt area Exception vector area 0x1FC0 0400
0x1FC0 0000
Fig. 4-2 Memory Map
TMP19A43 (rev2.0) 4-1
Memory Map
TMP19A43
(Note 1) The internal ROM is mapped to: 0x1FC0_0000-0x1FC5_FFFF (384 KB) 0x1FC0_0000-0x1FC7_FFFF (512 KB) The internal RAM is mapped to: 0xFFFF_9000-0xFFFF_DFFF (20 KB) 0xFFFF_8000-0xFFFF_DFFF (24 KB) (Note 2) For the TMP19A43, a physical space of only 16 MB is available as external address space to be accessed. It is possible to place this 16-MB physical address space in a chip select area of your choice inside the 3.5-GB physical address space of the CPU. Access to internal memory, internal I/O space and reserved areas is given priority over access to the external address space. Therefore, access to the external address space is denied if any of the internal memory, internal I/O space or reserved areas are being accessed. (Note 3) Do not place an instruction in the last four words of a physical area, specifically the last four words of an area where memory is mounted for external ROM extension (this varies depending on the system of the user). Internal ROM: 0x1FC5_FFF0-0x1FC5_FFFF (384 KB) Internal ROM: 0x1FC7_FFF0-0x1FC7_FFFF (512 KB)
TMP19A43 (rev2.0) 4-2
Memory Map
TMP19A43
5.
Clock/Standby Control
The system operation modes contain the standby modes in which the processor core operations are stopped to reduce power dissipation. Fig. 5-1 State Transition Diagram of Each Operation Mode is shown below.
Reset Reset has been performed IDLE mode (CPU stop) (I/O selective operation) Instruction Interrupt NORMAL mode (fc/gear value) Instruction Interrupt STOP mode (Entire circuit stop)
(a) State Transition Diagram of Single Clock Mode
Reset
Reset has been performed
IDLE mode (CPU stop) (I/O selective operation)
Instruction Interrupt
Interrupt
NORMAL mode (fc/gear value)
Instruction
Instruction
Interrupt
Instruction
SLEEP mode (fs only)
Instruction Interrupt
SLOW mode (fs)
Interrupt
Instruction
STOP mode (Entire circuit stop)
(b) State Transition Diagram of Dual Clock Mode
Fig. 5-1 State Transition Diagram of Each Operation Mode
Reset
Reset has been performed
NORMAL mode fc = fpll = foscx4 fsys = fc/8 fsys = fosc/2 fperiph =fgear= fsys
Fig. 5-2 Default State of the System Clock
TMP19A43 (rev2.0) 5-1
Clock/Standby Control
TMP19A43
fosc: fpll: fc: fs: fgear: fsys:
Clock frequency to be input via the X1 and X2 pins Clock frequency multiplied (quadrupled) by the PLL High-frequency clock frequency Low-frequency clock frequency Clock frequency selected by the system control register SYSCR1 in the clock generator System clock frequency The CPU, ROM, RAM, DMAC, INTC and HSIO all operate according to this clock. The internal peripheral I/O operates according to the fsys/2 clock.
fperiph: Clock frequency selected by SYSCR1 (Clock to be input to the peripheral I/O prescaler)
5.1
Clock System Block Diagram
5.1.1
Main System Clock
* * * Allows for oscillator connection or external clock input. Clock gear (3/4, 1/2, 1/4, 1/8) (Default is 1/8.) Input frequency (high frequency)
Input frequency range 8 to 10 (MHz)* Maximum operating frequency 40 MHz Lowest operating frequency 4 MHz
* Clock gear 1/8 (default) is used when 8 MHz (MIN) is input. * Input frequency (low frequency)
Input frequency range 30 KHz to 34 KHz Maximum operating frequency 34 kHz Lowest operating frequency 15 kHz
When the low-speed clock gear 1/2 is used: 15 KHz (MIN)
(Note)
(precautions for switching the high-speed clock gear) Switching of clock gear is executed when a value is written to the SYSCR1 register. There are cases where switching does not occur immediately after the change in the register setting but the original clock gear is used for execution of instructions. If it is necessary to use the new clock for execution of the instructions following to the clock gear switching instruction, insert a dummy instruction (to execute a write cycle). To use the clock gear, ensure that you make the time setting such that Tn of the prescaler output from each block in the peripheral I/O is calibrated to TnTMP19A43 (rev2.0) 5-2
Clock/Standby Control
TMP19A43
5.1.2
Clock Gear
* * The high-speed clock is divided into 3/4, 1/2, 1/4 or 1/8. The internal I/O prescaler clock T0: fperiph/2, fperiph/4, fperiph/8 and fperiph/16
SYSCR0 SYSCR2
SYSCR1 ADC conversion clock fperiph (to peripheral I/O) fsgear
Warm-up timer fc fs fsgear 1/2
fgear
fsys SYSCR0 X1 X2 SYSCR1 3/4 1/2 1/4 1/8 PLL SYSCR1 SYSCR1 Eight frequency divisions after the reset has been performed fpll = fosc x 4 CPU
High-speed oscillator
fosc
fsys SYSCR0
ROM RAM
DMAC INTC fperiph /2 /4 /8 /16 HSIO SYSCR0 XT1 XT2 KWUP /2 Peripheral I/O ADC,TMRB/C, SIO, SBI, WDT, Port 2-phase pulse input counter Clock timer
Low-speed oscillator
Clock timer
fs to Warm-up timer T0 Input to peripheral I/O prescaler TMRB/C, SIO, SBI,
fsgear
2-phase pulse input counter SYSCR3 fsys/2
SCOUT
Fig. 5-3 Clock and Standby Related Block Diagram
TMP19A43 (rev2.0) 5-3
Clock/Standby Control
TMP19A43
5.2
5.2.1
CG Registers
System Control Registers
Bit symbol Read/Write After reset Function 7 XEN R/W 1 High-speed oscillator 6 XTEN R/W 0 Low-speed oscillator 5 RXEN R/W High-speed oscillator after the STOP mode is released 4 RXTEN R/W Low-speed oscillator after the STOP mode is released 3 R This can be read as "0." 2 WUEF R/W Control of warm-up timer (WUP) for oscillator 0 write: don't care 1 write: WUP Start 1 0 PRCK1 PRCK0 R/W R/W Select prescaler clock 00: fperiph/16 01: fperiph/8 10: fperiph/4 11: fperiph/2
SYSCR0
LITTLE BIG
(0xFFFF_EE00) (0xFFFF_EE03)
0: Stop 1: Oscillation
0: Stop 1: Oscillation 0: Stop 1: Oscillation 0: Stop 1: Oscillation
7 SYSCR1
6
SYSCKFLG
LITTLE BIG
(0xFFFF_EE01) (0xFFFF_EE02)
Bit symbol Read/Write After reset Function
R This can be read as "0."
SYSCR2
LITTLE BIG
(0xFFFF_EE02) (0xFFFF_EE01)
Bit symbol Read/Write After reset Function 7 DRVOSCH R/W 0 High-speed oscillator current control 0: High capability 1: Low capability 7 Bit symbol Read/Write After reset Function R This can be read as "0."
R 0 System clock status flag 0: High speed (fc) 1: Low speed (fs) 6 R/W 0 This can be read as "0."
5 SYSCK R/W 0 Select system clock
4 FPSEL R/W 0 Select fperiph
3 SGEAR R/W Select gear of low-speed clock
0 read: WUP finished 1 read: WUP operating 2 1 0 GEAR2 GEAR1 GEAR0 R/W R/W R/W 1 1 1 Select gear of high-speed clock (fc) 000: fc 001: reserved 010: fc3/4 011: reserved 100: fc/2 101: reserved 110: fc/4 111: fc/8
0: High speed (fgear) 0: fgear 1: Low 1: fc speed (fs) 5 4 WUPT1 WUPT0 R/W R/W 1 0 Select oscillator warm-up time 00: No WUP 01: 2 /Input frequency 10: 214 /Input frequency 11: 216 /Input frequency
0: fs/1 1: fs/2 3 2 STBY1 STBY0 R/W R/W 1 1 Select standby mode 00: Reserved 01: STOP 10: SLEEP 11: IDLE
1 R This can be read as "0."
0 DRVE R/W 0 1: Drive the pin even in the STOP mode.
SYSCR3
LITTLE BIG
(0xFFFF_EE03) (0xFFFF_EE00)
6 5 SCOSEL1 SCOSEL0 R/W R/W 0 1 Select SCOUT output 00: fsgear 01: fsys/2 10: fsys 11: T0
4 ALESEL R/W 1 Set ALE output width 0: fsysx1 1: fsysx2
3
2 R 0
1
0
This can be read as "0."
* *
Don't switch the SYSCK and the GEAR<2:0> simultaneously. If the system enters the STOP mode with SYSCR2 set at 1 (low capability), the setting will change to 0 (high capability) after the STOP mode is released.
* *
SYSCK can be switched when both of XEN and XTEN are set to "1." Be sure to set the RXEN and the RXTEN to 1 (oscillation) for the oscillator selected at the SYSCK. If a wrong setting is made, the oscillator selected by the SYSCK will oscillate.
*
The clock that has been selected with SYSCK oscillates without fail after making clear the STOP mode.
TMP19A43 (rev2.0) 5-4
Clock/Standby Control
TMP19A43
5.3
System Clock Controller
By resetting the system clock controller, the controller status is initialized to ="1,"="0" and ="111," and the system clock fsys changes to fc/8. (fc=fosc (original oscillation frequency)x4, because the original oscillation is quadrupled by PLL.) For example, when a 10-MHz oscillator is connected to the X1 or X2 pin, fsys becomes 5 MHz (=10x4x1/8) after the reset. Similarly, when the oscillator is not connected and an external oscillator is used to input a clock instead, fsys becomes the frequency obtained from the calculation "input frequencyx4x1/8."
5.3.1
Oscillation Stabilization Time (Switching between the NORMAL and SLOW modes)
The warm-up timer is provided to confirm the oscillation stability of the oscillator when it is connected to the oscillator connection pin. The warm-up time can be selected by setting the SYSCR2 depending on the characteristics of the oscillator. The SYSCR0 is used to confirm the start and completion of warm-up through software (instruction). After the completion of warm-up is confirmed, switch the system clock (SYSCR1). When clock switching occurs, the current system clock can be checked by monitoring the SYSCR1. Table 5-1 shows the warm-up time when switching occurs.
(Note 1) The time for warm-up is required even when an external clock (oscillator, etc.) is used
and providing stable oscillation because the internal PLL is used even in this case.
(Note 2) The warm-up timer operates according to the oscillation clock, and it can contain errors if there is any fluctuation in the oscillation frequency. Therefore, the warm-up time should be taken as approximate time.
Table 5-1 Warm-up Time
Warm-up time options SYSCR2 01 (28/oscillation frequency) 10 (214/oscillation frequency) 11 (216/ oscillation frequency) High-speed clock (fosc) 25.6 (s) 1.638 (ms) 6.554 (ms) Low-speed clock (fs) 7.8 (ms) 500 (ms) 2000 (ms) These values are calculated under the following conditions: fosc = 10 MHz, fs = 32.768 kHz
TMP19A43 (rev2.0) 5-5
Clock/Standby Control
TMP19A43
Transition from the NORMAL mode to the SLOW mode SYSCR2="xx": Select the warm-up time SYSCR0="1": Enable the low-speed oscillation (fs) SYSCR0="1": Start the warm-up timer (WUP) SYSCR0 Read: Wait until the state becomes "0" (WUP is finished) SYSCR1="1": Switch the system clock to low speed (fs) SYSCR1Read: Confirm that the current state is "1" (the current system clock is fs) SYSCR0="0": Disable the high-speed oscillation (fosc) Transition from the SLOW mode to the NORMAL mode SYSCR2="xx": Select the warm-up time SYSCR0="1": Enable the high-speed oscillation (fosc) SYSCR0="1": Start the warm-up timer (WUP) SYSCR0 Read: Wait until the state becomes "0" (WUP is finished) SYSCR1="0": Switch the system clock to high speed (fgear) SYSCR1Read: Confirm that the current state is "0" (the current system clock is fgear) SYSCR0="0": Disable the low-speed oscillation (fs) (Note) In the SLOW mode, the CPU operates with the low-speed clock, and the INTC, the clock timer, the 2-phase pulse input counter, the KWUP (dynamic pull-up), the IO port and the EBIF (external bus interface) are operable. Stop other internal peripheral functions before the system enters the SLOW mode.
5.3.2
System Clock Pin Output Function
The system clock, fsys, fsys/2 or fs, can be output from the P44/SCOUT pin. By setting the port 4 related registers, P4CR to "1" and P4FC to "1," the P44/SCOUT pin becomes the SCOUT output pin. The output clock is selected by setting the SYSCR3. Table 5-2 shows the pin states in each standby mode when the P44/SCOUT pin is set to the SCOUT output.
Table 5-2 SCOUT Output State in Each Standby Mode
Mode
SCOUT selection
NORMAL
SLOW
Standby mode IDLE SLEEP STOP
= "00" = "01" = "10" = "11"
Output the fsgear clock. Output the fsys/2 clock. Output the fsys clock. Output the T0 clock. Fixed to "0" or "1."
(Note)
The phase difference (AC timing) between the system clock output by the SCOUT and the internal clock is not guaranteed.
TMP19A43 (rev2.0) 5-6
Clock/Standby Control
TMP19A43
5.3.3
Reducing the Oscillator Driving Capability
This function is intended for restricting oscillation noise generated from the oscillator and reducing the power dissipation of the oscillator when it is connected to the oscillator connection pin. Setting the SYSCR2 to "1" reduces the driving capability of the high-speed oscillator. (low capability) This is reset to the default setting "0." When the power is turned on, oscillation starts with the normal driving capability (high capability). This is automatically set to the high driving capability state ( ="0") whenever the oscillator starts oscillation due to mode transition. Reducing the driving capability of the high-speed oscillator
fOSC C1 Oscillator C2 X2 pin X1 pin Enable oscillation SYSCR2
Fig. 5-4 Oscillator Driving Capability
5.3.4
Clock Frequency Division for Low-Speed System Clock
The low-speed clock (fs) can be divided into two by setting the system control register SYSCR1 to "1." This reduces the power dissipation in the SLOW mode. Set the clock frequency division during high-speed oscillation.
TMP19A43 (rev2.0) 5-7
Clock/Standby Control
TMP19A43
5.4
Prescaler Clock Controller
Each internal I/O (TMRB0-F, TMRC, SIO0-2 and SBI) has a prescaler for dividing a clock. The clock T0 to be input to each prescaler is obtained by selecting the "fperiph" clock at the SYSCR1 and the SYSCR0 and then dividing the clock according to the setting of SYSCR0. After the controller is reset, fperiph/16 is selected as T0. For details, please refer to Fig. 5-5 System Clock Transition Diagram.
5.5
Clock Multiplication Circuit (PLL)
This circuit outputs the fpll clock that is quadruple of the high-speed oscillator output clock, fosc. This lowers the oscillator input frequency while increasing the internal clock speed.
TMP19A43 (rev2.0) 5-8
Clock/Standby Control
TMP19A43
5.6
Standby Controller
The TX19A core has several low-dissipation modes. To shift to the STOP, SLEEP or IDLE (Halt or Doze) mode, set the RP bit in the CPO status register, and then execute the WAIT instruction. Before shifting to the mode, you need to select the standby mode at the system control register (SYSCR2). The IDLE, SLEEP and STOP modes have the following features: IDLE: Only the CPU is stopped in this mode. The internal I/O has one bit of the ON/OFF setting register for operation in the IDLE mode in the register of each module. This enables operation settings for the IDLE mode. When the internal I/O has been set not to operate in the IDLE mode, it stops operation and holds the state when the system enters the IDLE mode. Table 5-3 shows a list of IDLE setting registers.
Table 5-3 Internal I/O setting registers for the IDLE mode
Internal I/O TMRB0-F
TMRC
IDLE mode setting register TBxRUN
TCCR
SIO0-3 HSIO0-3 I2C/SIO(SBI) A/D converter WDT
SCxMOD1 HSCxMOD1 SBIBR1 ADMOD1 WDMOD
(Note 1) The Halt mode is activated by setting the RP bit in the status register to "0," executing the WAIT command and shifting to the standby mode. In this mode, the TX19A processor core stops the processer operation while holding the status of the pipeline. The TX19A gives no response to the bus control authority request from the internal DMA, so the bus control authority is maintained in this mode. (Note 2) The Doze mode is activated by setting the RP bit in the status register to "1" and shifting to the standby mode. In this mode, the TX19A processor core stops the processer operation while holding the status of the pipeline. The TX19A can respond to the bus control authority request given from the outside of the processor core.
SLEEP: Only the internal low-speed oscillator, the clock timer, the 2-phase pulse input counter and the dynamic pull-up circuit (KWUP) operate. STOP: All the internal circuits are brought to a stop. The standby mode selection ..Status of CP0.. is selected by the combination. Please do not execute the WAIT instruction in the setting of "X" in the following table. STBY HALT DOZE 1:0 RP=0 RP=1 RESERVED 00 X X STOP 01 STOP X SLEEP 10 SLEEP X IDLE 11 HALT DOZE
TMP19A43 (rev2.0) 5-9
Clock/Standby Control
TMP19A43
5.6.1
CG Operations in Each Mode
Table 5-4 Status of CG in Each Operation Mode
Clock source Oscillator Mode Normal Slow Idle (Halt) Idle (Doze) Sleep Stop Oscillation circuit PLL x Clock supply to peripheral I/O Partial supply (Note) Selectable Selectable fs only x : ON or clock supply x x Clock timer, 2-phase pulse input counter and KWUP x x: OFF or no clock supply x x x x Clock supply to CPU
(Note)
Peripheral functions that can work in the SLOW mode: INTC, external bus interface, IO port, clock timer, 2-phase pulse input counter and KWUP
5.6.2
Block Operations in Each Mode
Table 5-5 Block Operating Status in Each Operation Mode
Block TX19A processor core DMAC INTC External bus I/F IO port ADC DAC SIO HSIO I2C TMRB TMRC WDT 2-phase pulse input counter Dynamic pull-up (KWUP) RTC CG High-speed oscillator (fc) Low-speed oscillator (fs) : ON x: OFF (Note) x NORMAL SLOW IDLE (Doze) x IDLE (Halt) x x x x x x x x x x x x SLEEP x x x x x x x x x x x x x (fs only) STOP x x x x x x x x x x x x x x Static pull-up x x x x
ON/OFF selectable for each module
(Note)
When the system enters the SLOW mode, the high-speed oscillator must be stopped by setting the SYSCR1.
TMP19A43 (rev2.0) 5-10
Clock/Standby Control
TMP19A43
5.6.3
Releasing the Standby State
The standby state can be released by an interrupt request when the interrupt level is higher than the interrupt mask level, or by the reset. The standby release source that can be used is determined by a combination of the standby mode and the state of the interrupt mask register assigned to the status register in the system control coprocessor (CPO) of the TX19A processor core. Details are shown in Table 5-6. Release by an interrupt request Operations of releasing the standby state using an interrupt request vary depending on the interrupt enabled state. If the interrupt level specified before the system enters the standby mode is equal to or higher than the value of the interrupt mask register, an interrupt handling operation is executed by the trigger after the standby is released, and the processing is started at the instruction next to the standby shift instruction (WAIT instruction). If the interrupt request level is lower than the value of the interrupt mask register, the processing is started with the instruction next to the standby shift instruction (WAIT instruction) without executing an interrupt handling operation. (The interrupt request flag is maintained at "1.") For a nonmaskable interrupt, an interrupt handling is executed after the standby state is released irrespectively of the mask register value. Release by the reset Any standby state can be released by the reset. Note that releasing of the STOP mode requires sufficient reset time to allow the oscillator operation to become stable. (Table 5-1 Warm-up Time). Please refer to "6. Interrupt" for details of interrupts for STOP, SLEEP and IDLE release and ordinary interrupts.
TMP19A43 (rev2.0) 5-11
Clock/Standby Control
TMP19A43
Standby Release Sources and Standby Release Operations
(Interrupt level)>(Interrupt mask)
Table 5-6
Interrupt accepting state Standby mode INTWDT Standby release source INT0-B KWUP00-31 INTRTC INTTB2-3 (Note 2) INTTB0-F INTRX0-2,INTTX0-2 HINTRX00-2,HINTTX0-2 INTS0 INTAD/INTADHP/INTADM x x x x Interrupt enabled EI= "1" IDLE SLEEP STOP (programmable) x x
(Note 1) (Note 1)
Interrupt disabled EI= "0" IDLE SLEE STOP P (programmable) - -
(Note 1) (Note 1)
Interrupt
x x x x x x x x x x
x x x x x x
: Starts the interrupt handling after the standby mode is released. (The LSI is initialized by the reset.) : Starts the processing at the address next to the standby instruction (without executing the interrupt handling) after the standby mode is released. x : Cannot be used for releasing the standby mode - : Cannot execute masking with an interruption mask when a nonmaskable interrupt is selected.
(Note 1) The standby mode is released after the warm-up time has elapsed. (Note 2) These operations are applicable only when the 2-phase pulse input counter mode is selected. If any other modes are selected, the operations will be the same as those for the INTTB0 to INTTBF. (Note 3) To release the standby mode by using the level mode interrupt in the interruptible state, keep the level until the interrupt handling is started. Changing the level before then will prevent the interrupt processing from starting properly. (Note 4) To recover from the standby mode when the CPU has disabled the acceptance of interrupts, set the interrupt level higher than the interrupt mask (Interrupt level > Interrupt mask). If the interrupt level is equal to or lower than the interrupt mask (Interrupt level Interrupt mask), the system cannot recover from the standby mode.
TMP19A43 (rev2.0) 5-12
Clock/Standby Control
TMP19A43
5.6.4
STOP Mode
In the STOP mode, all the internal circuits, including the internal oscillators, are brought to a stop. The pin states in the STOP mode vary depending on the setting of the SYSCR2. Table 5.8 shows the pin states in the STOP mode. When the STOP mode is released, the system clock output is started after the elapse of warm-up time at the warm-up counter to allow the internal oscillators to stabilize. After the STOP mode is released, the system returns to the operation mode that was active immediately before the STOP mode (NORMAL or SLOW), and starts the operation. It is necessary to make these settings before the instruction to enter the STOP mode is executed. Specify the warm-up time at the SYSCR2.
(Note)
To shift from the NORMAL mode to the STOP mode on the TMP19A43, do not set the SYSCR2 to "00" or "01" for the warm-up time setting. The internal system recovery time cannot be satisfied when the system recovers from the STOP mode.
Table 5-7 Warm-up Settings for Transitions of Operation Modes
Transition of operation mode NORMAL IDLE NORMAL SLEEP NORMAL SLOW NORMAL STOP IDLE NORMAL SLEEP NORMAL SLEEP SLOW SLOW NORMAL SLOW SLEEP SLOW STOP STOP NORMAL STOP SLOW Warm-up setting Not required Not required Not required Not required Not required Required Not required Required (Note 1) Not required Not required Required Required
(Note 1) When the high-speed oscillator is stopped in the SLOW mode
TMP19A43 (rev2.0) 5-13
Clock/Standby Control
TMP19A43
5.6.5
1.
Recovery from the STOP or SLEEP Mode
Transition of operation modes: NORMAL STOP NORMAL
System clock off fsys (High-speed clock) mode CG (High-speed clock) Start of high-speed clock oscillation Warm-up (W-up) Start of warm-up End of warm-up
NORMAL
STOP
NORMAL
when @fosc=10 MHz
Selection of warm-up time SYSCR2 01 (28/fosc) 10 (214/fosc) 11 (216/fosc) Warm-up time (fosc) Setting disabled 1.638 ms 6.554 ms
(Note) 2.
The internal system recovery time cannot be satisfied. Do not set to "01."
Transition of operation modes: NORMAL SLEEP NORMAL
System clock off
fsys (High-speed clock) mode
NORMAL
SLEEP
NORMAL
CG (High-speed clock)
CG (Low-speed clock)
Low-speed clock
(fs) continues oscillation
Warm-up (W-up)
Start of high-speed clock oscillation Start of warm-up
End of warm-up
when @fosc=10 MHz
Selection of warm-up time SYSCR2 01 (28/fosc) 10 (214/fosc) 11 (216/fosc) Warm-up time (fosc) Setting disabled 1.638 ms 6.554 ms
(Note)
The internal system recovery time cannot be satisfied. Do not set to "01."
TMP19A43 (rev2.0) 5-14
Clock/Standby Control
TMP19A43
3.
Transition of operation modes: SLOW STOP SLOW
System clock off
fsys (Low-speed clock) mode
SLOW
STOP
SLOW
CG (Low-speed clock) Start of low-speed clock oscillation Start of warm-up
Warm-up (W-up)
End of warm-up
when @fs=32.768 kHz
Selection of warm-up time SYSCR2 11 (216/fs) Warm-up time (fs) 2000 ms
4.
Transition of operation modes: SLOW SLEEP SLOW
System clock off
fsys (Low-speed clock) mode
SLOW
SLEEP
SLOW
CG (fs) (Low-speed clock)
(Note)
The low-speed clock (fs) continues oscillation. warm-up setting.
There is no need to make a
TMP19A43 (rev2.0) 5-15
Clock/Standby Control
TMP19A43
Table 5-8 Pin States in the STOP Mode in Each State of SYSCR2 (1/2)
Pin name P00-P07 P10-P17 Input/output Input mode Output mode AD0-AD7, D0-D7 Input mode Output mode, A8-A15 AD8-AD15, D8-D15 A8-A7 (Output mode) Input mode Output mode, A0-A7/A16-A23 (Output mode) Output pin /RD,/WR(Output mode) Input mode Output mode /HWR,/BUSAKR/W(Output mode) Input mode Output mode ALE (Output mode) Input mode Output mode /CS0-/CS2 (Output mode) KEY24-KEY27 (Input mode) Input mode Output mode Input mode Output mode, A0-A5 (Output mode) Input mode Output mode A6, A7 (Output mode) KEY28, KEY29 (Input mode) Input mode Output mode A9, A12 (Output mode) INTA, INTB (Input mode) Input mode Output mode, A8, A10, A11, A13-A15 (Output mode) Input mode Input mode KEY00-KEY03 (Input mode) Input mode KEY04-KEY07 (Input mode) Input mode INT6-INT9 (Input mode) Input mode Output mode Input mode Output mode INT0-INT5 (Input mode) Input mode Output mode Input mode Output mode Input mode Output mode KEY30 (Input mode) Input mode Output mode =0 Output Output Output Output "L" level output Output Input Output Output Input Output Input Output Input Input Input Input Input Input Input Input =1 Output Output Output Input Output Output Output Output Input Output Output Input Output "L" level output Input Output Output Input Input Output Input Output Input Output Input Output Input Output Input Input Input Input Output Input Output Input Input Output Input Output Input Output Input Input Output
P20-P27
P30 (/RD), P31 (/WR) P32(/HWR) P35(/BUSAK, P36(R/W) P37 (ALE)
P40-P43
P44 -P47 P50-P55
P56, P57
P61, P64
P60, P62, P63, P65-P67 P70-73 P74-77 P80-P83 P84-P87 P9 PA0-PA5
PA6, PA7 PB0-PB7 PC0
PC1-PC7
TMP19A43 (rev2.0) 5-16
Clock/Standby Control
TMP19A43
Pin name PD0-PD5 PD6
PE0-PE7
PF0-PF7
PG, PH
Input/Output Input mode Output mode Input mode Output mode KEY30 (Input mode) Input mode Output mode KEY08-KEY15 (Input mode) Input mode Output mode KEY16-KEY23 (Input mode) Input mode Output mode Input pin Input pin Input pin Output pin Input pin Output pin
=0 Input Input Input Input Input "H" level output "H" level output
=1 Input Output Input Output Input Input Output Input Input Output Input Input Output Input Input "H" level output "H" level output
RESET TEST X1
X2 XT1 XT2
: Indicates that the input is disabled for the input mode and the input pin and the impedance becomes high for the output mode and the output pin. Note that the input is enabled when the port function register (PxFC) is "1" and the port control register (PxCR) is "0." : The input gate is active. To prevent the input pin from floating, fix the input voltage to the "L" or "H" level. : This is the programmable pull-up pin. The input gate is always disabled. No feedthrough current flows even if the high impedance is selected.
Input
Output : The pin is in the output state. PU*
TMP19A43 (rev2.0) 5-17
Clock/Standby Control
TMP19A43
(note)
19A43 requires a recovery time from Warming up state as following
RESET
Reset Release
IDLE Mode (CPU Stop) (Selective I/O )
Software Interrupt Softwar
NORMAL Mode (fc/ gear)
A
Software
F
SLEEP Mode (fs)
C Interrupt
Softwar G
Interrupt
E
STOP Mode
All Stoped
SLOW Mode (fs)
Soft
B Interrupt
Softwar
D Interrupt
H
WUP Trigger
State Transition Diagram State Running Mode after WUP Minimum required Operation time Transition before WAIT instruction done (sec)
STOP release
A
B
C D
STOP/SLEEP
STOP/SLEEP
STOP/SLEEP STOP/SLEEP
64 / fsys
16 / fsys
64 / fsys
in NOMAL mode
in SLOW mode
in NOMAL mode -
SLEEP release
WUP Trigger
Software release
State
E
F
Transition
STOP
SLEEP
Minimum required Operation time before WAIT instruction done (sec) 16 / fs in NOMAL mode
16 x fs in NOMAL mode
TMP19A43 (rev2.0) 5-18
Clock/Standby Control
TMP19A43
6.
Exceptions/Interrupts
6.1 Overview
The TMP19A43 device is configured with the following 50 maskable interrupt factors and 15 exceptions including NMI. In this section, general exceptions and debug exceptions are described simply as "exceptions" and interrupts are described as "interrupts." * General exceptions Reset exception Non-maskable interrupt (NMI) Address error exception (instruction fetch) Address error exception (load/store) Bus error exception (instruction fetch) Bus error exception (data access) Co-processor unusable exception Reserved instruction exception Integer overflow exception Trap exception System call exception Breakpoint exception * Debug exception Single step exception Debug breakpoint exception * Interrupts Maskable software interrupts (2 factors) Maskable hardware interrupts: 46 internal factors and 48 external factors (INT0 - F, KEY00 - 31) The TMP19A43 device not only processes interrupt requests from internal hardware peripherals and external inputs but also forces transition to exception handling processes as a means of notifying any error status generated in normal instruction sequences. By using the register bank called "shadow register set" newly implemented in the TX19A processor core, it is now unnecessary to save the general purpose register (GPR) contents elsewhere upon interrupt response thus leading to very fast interrupt response. The device is capable of handling multiple interrupts according to seven programmable interrupt levels (priority orders). Also, it can mask interrupt requests with a priority level the same or lower than a specified mask level.
TMP19A43 (rev2.0) 6-1
Exceptions/Interrupts
TMP19A43
6.2
Exception Vector
The starting address of an exception handler is defined to be "exception vector address." The exception vector address for a reset exception and non-maskable interrupts is 0xBFC0_0000. The exception vector address for a debug exception can be either 0xBFC0_0480 (EJTAG ProbEn = 0) or 0xFF20_0200 (EJTAG ProbEn = 1) depending on the internal signal . For other exceptions, the corresponding exception vector addresses are determined depending on the values of Status and Cause of the system control coprocessor register (CP0). Table 6.21 Exception Vector Table (Virtual Address)
Exception Reset, NMI Debug exceptions (En=0) Debug exceptions (En=1) Interrupts (IV=0) Interrupts (IV=1) Others general exceptions BEV=0 0xBFC0_0000 0xBFC0_0480 0xFF20_0200 0x8000_0180 0x8000_0200 0x8000_0180 BEV=1 0xBFC0_0000 0xBFC0_0480 0xFF20_0200 0xBFC0_0380 0xBFC0_0400 0xBFC0_0380
(Note 1)
If exception vector addresses are to be placed in internal ROM, set the status bit of the system control coprocessor register (CP0) to "1."
6.3
Reset Exception
A reset exception is generated by either setting the external reset pin to "L" or counting the WDT beyond a "reset" count. When a reset exception is generated, peripheral hardware registers and the CP0 register are initialized and it jumps to the exception vector address 0xBFC0_0000. The PC value of reset exception generation will be stored in ErrorEPC of the CP0 register. Since a reset exception causes to set the status bit of the CP0 register to "1" disabling interrupt requests, the Status bit must be cleared to "0" in a startup routine (reset exception handler) or by any other means if interrupts are to be used. Refer to the section "Exception Handling, Reset Exception" of the separate volume "TX19A Core Architecture" for detailed operation upon generation of reset exception.
TMP19A43 (rev2.0) 6-2
Exceptions/Interrupts
TMP19A43
6.4
Non-maskable Interrupt (NMI)
An NMI interrupt is generated when WDT is counted to an NMI set count or when a bus error area is accessed by store access including DMA transfer. When an NMI interrupt is generated, the status bits and of the CP0 register are set to "1" and it jumps to the exception vector address 0xBFC0_0000. The PC value of NMI generation will be stored in ErrorEPC of the CP0 register. Note that any NMI due to a bus error upon a store instruction causes an exception that is not synchronized with instruction sequence. Therefore, the PC value of an instruction being executed at the time of error generation will be stored instead of the PC value for the instruction that actually caused the error. Upon NMI generation, when the shadow register set is enabled, SSCR will be overwritten by the value of SSCR but the register bank will not be switched because the value of SSCR is not updated. The reason why only the SSCR value is updated is because it is necessary to prevent the register bank from being changed when SSCR is overwritten by the value of SSCR due to an ERET instruction executed upon returning from NMI. The cause of NMI generation can be determined by NMIFLG and of CG. (Refer to the Section 6.10, NMI Flag Register Reference.) Refer to the section "Exception Handling, Non-Maskable Interruptions" of the separate volume "TX19A Core Architecture" for detailed operation upon generation of NMI.
6.5
General Exceptions (Other than Reset Exception and NMI)
A general exception will be generated when a specific instruction such as SYSCALL is executed or when any abnormalities such as an illegal instruction fetch is detected. When a general exception is generated and if Status of the CP0 register is "1," it jumps to the exception vector address 0xBFC0_380. The cause of a general exception can be determined by Cause of the CP0 register. The PC value at a general exception will be stored in EPC of the CP0 register. Note that any bus error exception (data access) is not synchronized with instruction sequence so the PC value of an instruction being executed at the time of error generation will be stored instead of the PC value for the instruction that actually caused the error. Upon a general exception, when the shadow register set is enabled, SSCR will be overwritten by the value of SSCR but the register bank will not be switched because the value of SSCR is not updated. The reason why only the SSCR value is updated is because it is necessary to prevent the register bank from being changed when SSCR is overwritten by the value of SSCR due to an ERET instruction executed upon returning from the exception. Any illegal address that caused an address error exception (instruction fetch or load/store) or bus error (instruction fetch/data access) will be stored in BadVAddr of the CP0 register. Refer to the corresponding sections of "Exception Handling" of the separate volume "TX19A Core Architecture" for detailed operation upon generation of general exceptions.
(Note 1)
Address error exceptions (load/store) will not be generated in DMS transfer operations. In DMA transfer, address errors can be detected as configuration errors (CSRx of DMAC). Bus errors (data access) may be generated either by load instructions or by load accesses of DMA transfer operations.
(Note 2)
TMP19A43 (rev2.0) 6-3
Exceptions/Interrupts
TMP19A43
Automatically jump to exception vector address
Processes of TX19A core
Read Cause to determine the factor of generation
Read Table for the address of exception handling if necessary
Jump to exception handling
Save registers as necessary Processes of user software Exception handling (Note 1)
Return necessary registers
ERET
Return to exception generation address
Fig. 6-1 Example Sequence of General Exceptions (Other than Reset Exception and NMI)
(Note 1)
Since general exceptions (other than reset exception/NMI and excluding trap exceptions, system call exceptions, and breakpoint exceptions) indicate some sort of abnormal conditions, the system tends to be reset. Upon generation of a general exception other than reset exception/NMI, excluding bus error exceptions (instruction fetch/data access), the PC that caused the exception will be stored in EPC. Therefore, returning the system by simply using ERET may cause the same exception again.
(Note 2)
TMP19A43 (rev2.0) 6-4
Exceptions/Interrupts
TMP19A43
6.6
Debug Exceptions
Single step exceptions and debug breakpoint exceptions are the types of debug exceptions. These types of exceptions are seldom used in user programs. Also note that enabling the shadow register set will not be effective in debug exceptions. Refer to the section "Exception Handling, Debug Exception" of the separate volume "TX19A Core Architecture" for detailed operation upon generation of debug exceptions.
6.7
Maskable Software Interrupts
Two-factor maskable software interrupts (hereinafter referred to simply as "software interrupts") can be generated by individually setting "1" to the Cause bits of the CP0 register. Software interrupts can be accepted in no less than three clocks after setting values to the Cause bits of the CP0 register. In order for a software interrupt request to be accepted, it is necessary regarding the CP0 register that its Status is set to "1" and Status is cleared to "0" while Status is "1." Also, software interrupts can be individually masked by setting Status of the CP0 register to "0." If software and hardware interrupts coincide, the hardware interrupt overrides the software interrupt. Upon software interrupts, when the shadow register set is enabled, SSCR will be overwritten by the value of SSCR but the register bank will not be switched because the value of SSCR is not updated. The reason why only the SSCR value is updated is because it is necessary to prevent the register bank from being changed when SSCR is overwritten by the value of SSCR due to an ERET instruction executed upon returning from the software interrupt. Software interrupts are processed in a process flow such as shown in Fig. 6-2. (Note 1) (Note 2) Please read out the data in IVR after a software interrupt is generated. To read out the data is a trigger to notify the core of a hardware interrupt. The "software interrupt," which is a maskable interrupt, can be generated by setting IP [1:0] of the Cause register of CP0. This "software interrupt" is different from the "software set," which is one of the hardware interrupt factors. The "software set" interrupt is generated by setting of the IMC0 register in the interrupt controller (INTC) to any value other than "0."
TMP19A43 (rev2.0) 6-5
Exceptions/Interrupts
TMP19A43
Set Cause =1 to generate interrupt
Processes of user software Processes of TX19A core
Automatically jump to exception vector address
Read Cause to determine the factor of generation
Set Cause = 0 to clear interrupt
Jump to interrupt handler
Save registers as necessary Processes of user software Interrupt processing
Return necessary registers
ERET instruction
Return to interrupt generation address Fig. 6-2 Example of Software Interrupt Operation
(Note 1)
A software interrupt is accepted in no less than three clocks after the instruction that enabled the interrupt and the PC at the time of acceptance is stored in EPC.
TMP19A43 (rev2.0) 6-6
Exceptions/Interrupts
TMP19A43
6.8
6.8.1
Maskable Hardware Interrupts
Features
The maskable hardware interrupts (hereinafter referred to as "hardware interrupts") are 64 factor interrupt requests for which the interrupt controller (INTC) can individually assign an interrupt level out of seven interrupt (priority) levels. In order for a hardware interrupt request to be accepted, it is necessary regarding the CP0 register that its Status is set to "1" and Status is cleared to "0" while Status is set to "1." If more than one interrupts are generated at the same time, the hardware interrupts are accepted in accordance with the priority order of the interrupt levels. If more than one interrupts of a same interrupt level are generated at the same time, these interrupts are accepted in the order of the interrupt number as listed in Table 6.8.1. When an interrupt request is accepted, the Status bit of the CP0 register is set to "1," further interrupts are disabled, and ILEV of INTC is automatically updated to the interrupt level set for the interrupt request. Note that Status of the CP0 register remains set to "1" in interrupt response operations. In processing hardware interrupts, each interrupt level is associated with a register bank called a "shadow register set." When an interrupt request is accepted, the register bank is switched to the register bank of which number is the same as with the corresponding interrupt level. Through this mechanism, it is unnecessary for the user program to save the general purpose register (GPR) contents elsewhere upon interrupt response thus ensuring fast interrupt response. CP0 register SSCR="0") For accepting multiple interrupts, Status of the CP0 register is cleared to "0" to permit further interrupts. In this, because ILEV of INTC has been updated to the interrupt level set for the interrupt request already accepted, only further interrupts of which level is higher than the present interrupt level can be accepted. Refer to Section 6.8.7 "Example of Multiple Interrupt Setting" for more details of multiple interrupts. Also, by appropriately setting the ILEV register of INTC, you can mask interrupt requests of which interrupt level is lower than a programmed mask level. Any interrupt request can be used as a trigger to start a DMA transfer sequence. While detailed operation of hardware interrupts is provided below, please also refer to the section "Exception Handling, Maskable Interrupts (Interrupts)" of the separate volume "TX19A Core Architecture" for more details.
TX19A Core
Notification
INTC
CG
Interrupts to clear Standby
Response
Other interrupts
Fig. 6-3 Interrupt Notification Diagram
TMP19A43 (rev2.0) 6-7
Exceptions/Interrupts
TMP19A43
Table 6.8.1 List of Hardware Interrupt Factors
Interrupt Number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 IVR[7:0] 0x000 0x004 0x008 0x00C 0x010 0x014 0x018 0x01C 0x020 0x024 0x028 0x02C 0x030 0x034 0x038 0x03C 0x040 0x044 0x048 0x04C 0x050 0x054 0x058 0x05C 0x060 0x064 0x068 0x06C 0x070 0x074 0x078 0x07C 0x080 0x084 0x088 0x08C 0x090 0x094 0x098 0x09C 0x0A0 0x0A4 0x0A8 0x0AC 0x0B0 0x0B4 0x0B8 0x0BC 0x0C0 0x0C4 0x0C8 0x0CC 0x0D0 0x0D4 0x0D8 0x0DC 0x0E0 0x0E4 0x0E8 0x0EC 0x0F0 0x0F4 0x0F8 0x0FC Interrupt Factor Software set INT0 pin INT1 pin INT2 pin INT3 pin INT4 pin INT5 pin INT6 pin INT7 pin INT8 pin INT9 pin INTA pin INTB pin INTC pin INTD pin INTE pin INTF pin KWUP INTRX0 : Serial receive (channel.0) INTTX0 : Serial transmit (channel.0) INTRX1 : Serial receive (channel.1) INTTX1 : Serial transmit (channel.1) INTRX2 : Serial receive (channel.2) INTTX2 : Serial transmit (channel.2) HINTRX0 : High speed serial receive (Hchannel.0) HINTTX0 : High speed serial transmit (Hchannel.0) HINTRX1 : High speed serial receive (Hchannel.1) HINTTX1 : High speed serial transmit (Hchannel.1) HINTRX2 : High speed serial receive (Hchannel.2) HINTTX2 : High speed serial transmit (Hchannel.2) INTS0 : Serial bus interface 0 INTADHP : Highest priority ADC complete interrupt INTADM : ADC monitor function interrupt INTTB0 : 16-bit timer 0 INTTB1 : 16-bit timer 1 INTTB2 : 16-bit timer 2 INTTB3 : 16-bit timer 3 INTTB4 : 16-bit timer 4 INTTB5 : 16-bit timer 5 INTTB6 : 16-bit timer 6 INTTB7 : 16-bit timer 7 INTTB8 : 16-bit timer 8 INTTB9 : 16-bit timer 9 INTTBA : 16-bit timer A INTTBB : 16-bit timer B INTTBC : 16-bit timer C INTTBD : 16-bit timer D INTTBE : 16-bit timer E INTTBF : 16-bit timer F INTCAPG0 : Input capture group 0 Reserved INTCMP0 : Compare interrupt 0 INTCMP1 : Compare interrupt 1 INTCMP2 : Compare interrupt 2 INTCMP3 : Compare interrupt 3 INTCMP4 : Compare interrupt 4 INTCMP5 : Compare interrupt 5 INTCMP6 : Compare interrupt 6 INTCMP7 : Compare interrupt 7 INTTBT : Overflow interrupt INTRTC : Clock timer interrupt INTAD : ADC completed INTDMA0 : Completion of DMA transfer (channel.0) INTDMA1 : Completion of DMA transfer (channel.1) Interrupt Control Register IMC0 Address 0xFFFF_E000
IMC1
0xFFFF_E004
IMC2
0xFFFF_E008
IMC3
0xFFFF_E00C
IMC4
0xFFFF_E010
IMC5
0xFFFF_E014
IMC6
0xFFFF_E018
IMC7
0xFFFF_E01C
IMC8
0xFFFF_E020
IMC9
0xFFFF_E024
IMCA
0xFFFF_E028
IMCB
0xFFFF_E02C
IMCC
0xFFFF_E030
IMCD
0xFFFF_E034
IMCE
0xFFFF_E038
IMCF
0xFFFF_E03C
TMP19A43 (rev2.0) 6-8
Exceptions/Interrupts
TMP19A43
(Note 1) (Note 2)
While IMCxx is a 32 bit register, 8 bit/16 bit access is also accepted. Each factor can clear the IDLE mode. Table 6.8.2 Interrupt Factors to Cancel Stop/Sleep Modes
Number 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Interrupt Factor INT0 INT1 INT2 INT3 INT4 INT5 INT6 INT7 INT8 INT9 INTA INTB KWUP INTRTC INTTB2 INTTB3
Note External interrupt 0 External interrupt 1 External interrupt 2 External interrupt 3 External interrupt 4 External interrupt 5 External interrupt 6 External interrupt 7 External interrupt 8 External interrupt 9 External interrupt A External interrupt B Key on wake up interrupt Clock timer interrupt Two-phase pulse input counter interrupt 2 Two-phase pulse input counter interrupt 3
* Number 0 to 12 interrupt factors can cancel Stop, Sleep, and Idle modes. * Number 13 to 15 interrupt factors can cancel the Sleep mode.
TMP19A43 (rev2.0) 6-9
Exceptions/Interrupts
TMP19A43
6.8.2
Detecting Interrupt Requests
Each of interrupt factors has its own interrupt detection sequence as described in Table 6.8. Upon detection, an interrupt request is notified to INTC for priority arbitration and then notified to the TX19A processor core. Refer to Table 6.8 for the detection level available for each interrupt factor. Table 6.8.3 Location of Interrupt Request Detection
Interrupt Detected by CG INTC INTC CG INTC CG INTC Interrupt Notification Route PORT CG (detection) INTC (arbitration) PORT INTC (detection/arbitration) PORT INTC (detection/arbitration) PORT CG (detection) INTC (arbitration) PORT INTC (detection/arbitration) PORT CG (detection) INTC (arbitration) TX19A core TX19A core TX19A core TX19A core TX19A core TX19A core
(1) Interrupts from external pins INT0 - INTB (2) Interrupts from external pins INTC - INTF (3) Key on wakeup interrupt KWUP00-31 (4) RTC interrupt RTC (5) Other interrupts
Peripheral circuit INTC (detection/arbitration) TX19A core
6.8.3
1.
Interrupt Priority Arbitration
Seven levels of interrupt priority Each of interrupt factors can be individually set to one of the seven interrupt priority levels by INTC. The interrupt level to be applied is set by IMCxx of INTC. The higher the interrupt level set, the higher the priority. If the value is set to "000" meaning interrupt level of 0, no interrupts will be generated by the factor. Also note that any factors of interrupt level 0 are not suspended.
2.
Interrupt Level Notification When an interrupt request is generated, INTC compares the interrupt level with the mask level. If the interrupt level is higher than the mask level set in ILEV , it notifies the TX19A processor of the interrupt request. If more than one interrupts are generated at the same time, the interrupts are notified in accordance with the priority order of these interrupt levels. If more than one interrupts of a same interrupt level are generated at the same time, these interrupts are notified in the order of the interrupt number as listed in Table 6.8.1. When an interrupt request of the same interrupt factor is received again before the previous interrupt has been cleared, only the first interrupt can be accepted.
3.
INTC Register Update When an interrupt request is accepted by the TX19A core, the highest interrupt level at that point in time will be set to ILEV and the corresponding vector value is set to IVR. Once CMASK and IVR are set, any interrupt with a higher interrupt level cannot update them or cause notification to the core until the IVR value is read.
(Note 1)
So, be sure to read the IVR value before attempting to change the ILEV value. If the ILEV value is changed before reading IVR, an unexpected interrupt request may be generated.
TMP19A43 (rev2.0) 6-10
Exceptions/Interrupts
TMP19A43
6.8.4
Hardware Interrupt Operation
When a hardware interrupt is generated, the TX19A core will go through the following steps to jump to the corresponding exception vector address as given in Table 6.21 according to the Status and Cause bits of the CP0 register. (1) Sets Status of CP0 register to "1." (2) Sets the PC value at the interrupt generation to EPC of the CP0 register. (3) If the shadow register set is enabled (CP0 register SSCR = 0), SSCR of the CP0 register will be updated and it switches to the register bank of the same interrupt level number. (4) The values of ILEV of INTC will be updated and the mask level is set to the interrupt level of the interrupt request accepted. (5) Sets IVR [7:0] to the corresponding value listed in Table 6.8.1.
TMP19A43 (rev2.0) 6-11
Exceptions/Interrupts
TMP19A43
Automatically jump to the exception vector address after interrupt generation
Processes of TX19A core
Read IVR to generate interrupt vector address
Clear interrupt factor by INTCLR
Read interrupt handler address from interrupt vector
Jump to interrupt handler
Save necessary registers (Note 1) Processes of user software Interrupt processing
Return the mask level by setting ILEV = 0
Return necessary registers (Note 1)
ERET instruction
Return to interrupt generation address Fig. 6.8.4 Basic Operation of Hardware Interrupts (Example)
(Note 1)
By using the shadow register set (setting CP0 register SSCR = 0), most of general purpose register contents can be automatically saved in TX19A core.
TMP19A43 (rev2.0) 6-12
Exceptions/Interrupts
TMP19A43
6.8.5
Initialization for Interrupts
Before using interrupts, it is necessary to appropriately configure them. Necessary settings that have to be made regardless of the interrupt factors are described in Section 6.8.5.1 "Common Initialization" and settings specifically required for certain factors and applications are described in Section 6.8.5.2 "Initialization for Individual Interrupt Factors."
6.8.5.1
Common Initialization (1) Set Status of CP0 register to "111." (2) Set the base address of the interrupt vector table to IVR [31:8] of INTC. (3) Set the interrupt handler addresses for the respective interrupt factors to the addresses obtained as the sum of the base address of "the interrupt vector table and the IVR [7:0] values corresponding to the respective interrupt factors."
In order to use interrupts, the following settings are necessary:
Example of the above step (1): When the interrupt exception vector address 0xBFC00400 is used lui addiu mtc0 r2,0x1040 r2,r2,0x1C00 r2,r12 ; CU0=1, BEV =1 (r2 =0x1040_xxxx) ; IM4,IM3,IM2 =1 (r2 =0x1040_1C00)
Example of the above step (2): If Vector Table is used as the label of the interrupt vector table lui addiu lui sw r3,hi(VectorTable) r3,r3,lo(VectorTable) r2,hi(IVR) r3,lo(IVR)(r2) ; r3 = VectorTable address ; r2 =0xFFFF_xxxx (Upper 16 bits of IVR address) ; Set address of VectorTable to IVR[31:8]
Example of the above step (3): If the base address of interrupt vector is set to 0xBFC20000 _VectorTable section code isa32 abs=0xBFC20000 VectorTable: dw dw dw dw dw dw dw dw dw _SWINT _INT0 _INT1 _INT2 _INT3 _INT4 _INT5 _INT6 _INT7 ; 0 --- software interrupt ; 1 --- INT0 ; 2 --- INT1 ; 3 --- INT2 ; 4 --- INT3 ; 5 --- INT4 ; 6 --- INT5 ; 7 --- INT6 ; 8 --- INT7
(Note 1)
The above examples assume the use of Assembler made by Toshiba. If any third party Assembler is used, it may generate syntax errors; you are advised to modify the above statements according to the Assembler to be used.
TMP19A43 (rev2.0) 6-13
Exceptions/Interrupts
TMP19A43
6.8.5.2
Initialization for Individual Interrupt Factors
The registers to be set in using different interrupt factors are as listed below: Table 6.8.4 Registers to be Set for Detecting Interrupts
Interrupt Registers to be Set Interrupt detection levels available (setting in active condition)
(1) Interrupts from external pins INT0 - INTB
(2) Interrupts from external pins INTC - INTF (3) Key on wakeup interrupt KWUP00 - 31
(4) INTRTC interrupt
(5) Other interrupts (Note 1)
PxFC(PORT) PxCR(PORT) IMCxx(INTC) PxFC(PORT) PxCR(PORT) IMCGx(CG) IMCxx(INTC) PxFC(PORT) PxCR(PORT) IMCxx(INTC) PxFC(PORT) PxCR(PORT) IMCxx(INTC) PxFC(PORT) PxCR(PORT) IMCGx(CG) IMCxx(INTC) PxFC(PORT) PxCR(PORT) IMCGx(CG) IMCxx(INTC) IMCxx(INTC)
With INTC, "L" and "H" levels and falling and rising edges can be set. If it is to be used for recovery from Standby mode, set "L" and "H" levels and falling and rising edges for CG while INTC must be set to "H." With INTC, "L" and "H" levels and falling and rising edges can be set. With INTC and KWUP circuit, "L" and "H" levels and falling and rising edges can be set. If it is to be used for recovery from Standby mode, it must be set to "H" with INTC. With the KWUP circuit, "L" and "H" levels and falling/rising edges can be set. Set for rising edge with CG; it must be set to "H" with INTC.
With INTC, "L" and "H" levels and falling/rising edges can be set.
In level detection, the value is checked at internal clock timing each time. Edge detection is made by comparing the previous value with the current value at internal clock timing.
In interrupt initialization, follow the order of the interrupt detection route as indicated in Table 6.8 before enabling the interrupts with the CP0 register. If any different setting order is used, an unexpected interrupt may be generated. So, be sure to clear interrupt factors before setting interrupt permission. Similarly, if interrupts are to be disabled, first disable the interrupt by the CP0 register and then set the registers accordingly in the reverse order of interrupt detection.
(1) Interrupts from external pins (INT0 to INTB) * * * * * * Use PORT PxCR to enable an input port. (Refer to 7. Port Function) Use PORT PxFC to set pin functions to INT0 - INTB. (Refer to 7. Port Function) Use PORT PxPE to set pull-up connections as appropriate. (Refer to 7. Port Function) Use INTC IMCx to set active state. (Refer to 5.3.3 Interrupt-related Registers) Use IMCGx of CG for setting to enable/disable clearing of standby modes. (Refer to INTCG Registers, Interrupts to Clear STOP, SLEEP, and IDLE) Use INTC IMCx to set active state of internal interrupt signals to be notified from CG. If rising or falling edge is set with INTC IMCx , set it to falling edge (set IMCx to "10"). For H/L level setting, set it to "L" level (set IMCx to "00"). (Refer to 6.8.8 Registers.) TMP19A43 (rev2.0) 6-14
Exceptions/Interrupts
TMP19A43
* An example setting when an external interrupt "INT3" is used to clear Stop by the falling edge: Status = "0" PACR = "0" PAFC ="0" IMCGA ="010" IMCGA ="1" EICRCG ="0011" IMC1 ="01" INTCLR ="010" IMC1 ="101" ILEV/ ="1"/"xxx" SYNC instruction Status = "1" ; Interrupt is disabled ; The port is set to an input port ; The port is assigned to INT3 ; INT3 is set to falling edge ; INT3 is set to clear Standby mode ; Clears the INT3 standby clear request ; INT3 is set to level detection ; Clears the INT3 interrupt request ; Interrupt level of INT3 is set to "5." ; Mask level is set to "xxx." (To be set simultaneously with ILEV ) ; Stall until interrupt settings are enabled. ; Interrupt is enabled
* An example setting when an external interrupt "INT3" is to be disabled: Status = "0" IMC1 = "000" INTCLR ="010" (2) Interrupts from external pins (INTC to INTF) * * * Use PORT PxIER to enable an input port. (Refer to 7. Port Function) Use PORT PxFR to set pin functions to INTC - INTF. (Refer to 7. Port Function) Use INTC IMCx to set active state. (Refer to 6.8.8 Registers.) ; Interrupt is disabled ; INT3 interrupt is disabled. ; Clears the INT3 interrupt request
* An example setting when an external interrupt "INTF" is detected by the "H" level: Status = "0" P5CR = "0" P5FC = "0" IMC4 = "01" INTCLR = "0x040" IMC4 = "010" ILEV/ = "1"/ "xxx" Status = "1" ; Interrupt is disabled ; The port is set to an input port ; The port is set to an input port ; INTF is set to "H" level ; Clears the INTF interrupt request ; Interrupt level of INTF is set to "2." ; Mask level is set to "xxx." (To be set simultaneously with ILEV ) ; Interrupt is enabled
TMP19A43 (rev2.0) 6-15
Exceptions/Interrupts
TMP19A43
(3) Key on Wakeup interrupt, KWUP00 to 31 * * * * * * * Use PORT PxCR to enable the input port. (Refer to 7. Port Function) Use PORT PxFC to set the pin function to KEY. (Refer to 7. Port Function) Use PORT PxPE to set pull-up connections as appropriate. (Refer to 7. Port Function) Use KWUPSTxx to enable KEY ON Wakeup. (Refer to 20. KEY ON Wakeup Circuit) Set active state of KEY. (Refer to 20. KEY ON Wakeup Circuit.) Use INTC IMCx to set active state. (Refer to 5.3.3 Interrupt-related Registers) Use IMCGx of CG for setting to enable/disable clearing of Standby. (Refer to INTCG Registers, Interrupts to Clear STOP, SLEEP, and IDLE)
* An example setting when KEY08 is used as an input to clear Stop (dynamic pull-up, falling edge): Status = "0" PECR = "0" PEFC = "0" PEPE = "1" KWUPCNT = "0x24" KWUPST08 = "1" KWUPST08 = "010" KWUPST08 = "1" KWUPCLR = "1010" IMCGD = "10" IMCGD = "1" EICRCG = "1100" IMC4 = "01" IMC4 = "110" ILEV/ ="1"/"xxx" SYNC instruction Status = "1" ; Interrupt is disabled ; The port is set to work as an input port. ; The port is set to KEY input. ; Pull-up is set to the port. ; The period of dynamic pull-up is set. (Example: Period; 10:1024/fs, Duration: 01:4/fs) ; Dynamic pull-up is set. ; It is set to falling edge. ; Key input is enabled. ; Key input factor is cleared. ; Standby clear setting is set to "H" level ; KWUP is set to clear Standby mode. ; Clears KWUP standby clear request ; KWUP is set to H level. ; Interrupt level of KWUP is set to "6." ; Mask level is set to "xxx." (To be set simultaneously with ILEV ) ; Stall until interrupt settings are enabled. ; Interrupt is enabled
TMP19A43 (rev2.0) 6-16
Exceptions/Interrupts
TMP19A43
(4) Other hardware interrupts * * Settings are made to use peripheral hardware devices. Set INTC IMCxx to "10." (Refer to 6.8.8 Registers.)
(Note 1)
In interrupt initialization, set INTC registers before enabling interrupts with the CP0 register. Similarly, if interrupt is to be disabled, first disable interrupt by the CP0 register and then set INTC. Interrupt Enable
6.8.5.3
In order for an interrupt request to be accepted, all the following parameters must be set to enable the interrupt in addition to the initial settings described in Section 6.8.5 "Initialization for Interrupts." * * * Set Status of the CP0 register to "0." Set Status of the CP0 register to "0." Set Status of the CP0 register to "1."
By these settings, interrupt is enabled two clocks after execution of the instruction and the registers are set. Note that one of the following methods may be used in setting Status of the CP0 register to "1." * * Set IER of the CP0 register to any value other than "0" using the MTC0 instruction (32 bit ISA instruction). (Note 1) Execute the EI instruction of 16 bit ISA. (Note 2)
(Note 1) If Toshiba C compiler is used, this is executed by the 32 bit ISA instruction "_ _EI ( ) embedded function." (Note 2) If Toshiba C compiler is used, this instruction is executed by the 16 bit ISA instruction "_ _EI ( ) embedded function." (Note 3) The following different methods may also be used to set Status of the CP0 register to "1." * Set Status of the CP0 register to "1" using the MTC0 instruction of 32 bit ISA. * Set Status of the CP0 register to "1" using the MTC0 instruction of 16 bit ISA.
TMP19A43 (rev2.0) 6-17
Exceptions/Interrupts
TMP19A43
6.8.5.4
Interrupt Disable
To disable interrupts, either one of the following setting procedures must be performed in addition to the settings described in Section 6.8.5 "Initialization for Interrupts." When interrupts are disabled, any interrupt request will be suspended. Also note that TMP19A43 doesn't suspend any interrupt factor that is set to interrupt level 0. * * * Set Status of the CP0 register to "1." Set Status of the CP0 register to "1." Set Status of the CP0 register to "0."
By these settings, interrupts are disabled immediately after execution of the instruction and the registers are set two clocks later. Note that either of the following methods may be used in setting Status of the CP0 register to "0." * * Set IER of the CP0 register to "0" using the MTC0 instruction of 32 bit ISA. (Note 1) Execute the DI instruction of 16-bit mode ISA. (Note 2)
(Note 1) If Toshiba C compiler is used, this instruction is executed by the 32 bit ISA instruction "_ _DI ( ) embedded function." (Note 2) If Toshiba C compiler is used, this instruction is executed by the 16 bit ISA instruction "_ _DI ( ) embedded function." (Note 3) The following different methods may also be used to set Status of the CP0 register to "0." * Set Status of the CP0 register to "0" using the MTC0 instruction of 32 bit ISA. * Set Status of the CP0 register to "0" using the MTC0 instruction of 16 bit ISA.
TMP19A43 (rev2.0) 6-18
Exceptions/Interrupts
TMP19A43
If the factors once enabled are to be individually disabled again after setting interrupt levels by IMCx of INTC, first set the Status bits of the CP0 register to disable interrupts and then disable relevant factors individually. Example statements to individually disable interrupt factors: mtc0 sb sync mtc0 (Note 4) r29, IER r0, IER r0, IMCxx ; Interrupt is disabled (Status = "0") ; Disable interrupt factors ; Stall until it is write-enabled. ; Interrupt is enabled (Status = "1")
The above examples assume use of Assembler made by Toshiba. If any third party Assembler is used, it may generate syntax errors; you are advised to modify the above statements according to the Assembler to be used.
TMP19A43 (rev2.0) 6-19
Exceptions/Interrupts
TMP19A43
6.8.6
Interrupt Processing
This section describes detailed operation of interrupt processing using the basic flow chart of Fig. 6.8.
6.8.6.1 Interrupt Response and Return Hardware processes to accept interrupts After interrupt request arbitration, INTC sets the interrupt vector and interrupt level of the interrupt request accepted to IVR and ILEV, respectively, to notify the TX19A processor core of the interrupt level. When the interrupt level is notified, the TX19A processor core sets Status of the CP0 register to "1" to disable interrupts and saves the PC value at the interrupt generation to EPC. If the shadow register set is enabled (CP0 register SSCR = 0), the processor core sets the interrupt level to SSCR of the CP0 register and switches the register bank. When an interrupt is accepted, any ongoing execution is suspended and it automatically jumps to the exception vector address (for interrupts). Fig. 6-4 shows the sequence of accepting interrupts.
Interrupt detection
Compared to ILEV , interrupt level is Higher The highest priority interrupt request? YES Both Status and are 0? YES Status? 1 YES Branch delay Within slot?
Lower
NO
NO
0
NO Interrupt suspended
* Set 1 to Cause * Set the PC of Jump or Branch instruction to EPC
* Set 0 to Cause * Set PC to EPC
Set 0x00 to Cause Set Status = 1 Set interrupt level to SSCR .
If Cause =0, then Set 0xBFC0_0380 to PC If Cause = 1, then Set 0xBFC0_0400 to PC
Jump to exception vector address
Fig. 6-4 Hardware Process Flow to Accept Interrupts TMP19A43 (rev2.0) 6-20 Exceptions/Interrupts
TMP19A43
Processes to be performed by the exception handler After an interrupt request is accepted, it automatically jumps to the exception handler where the interrupt vector address is read from INTC IVR and the user program generates the address of the interrupt handler. As in the example statements presented in Section 6.8.5, "Initialization for Interrupts," the interrupt vector base address is set to IVR[31:8] so that the IVR value becomes the interrupt vector address. After reading the INTC IVR value, the interrupt factor is cleared. If the interrupt factor is cleared before IVR is read, correct value cannot be read because the IVR value is also cleared. Example exception handler statement: Exception vector address (interrupt) is 0xBFC0_0400. VECTOR_INT section code isa32 abs=0xBFC00400 __InterruptVector: lui lw lui sh lw jr nop (Note 1) The above example assumes use of Assembler made by Toshiba. If any third party Assembler is used, it may generate syntax errors; you are advised to modify the above statement according to the Assembler to be used. r26,hi(IVR) r26,lo(IVR)(r26) r27,hi(INTCLR) r26,lo(INTCLR)(r27) r26,0(r26) r26 ; Interrupt request is cleared ; Read interrupt handler address from interrupt vector ; Jump to interrupt handler ; Read IVR for interrupt vector address
Processes to be performed by the interrupt handler Typical tasks of the interrupt handler are to save appropriate registers and to process interrupts. If the shadow register set is enabled (CP0 register SSCR = 0), the general purpose register values other than r26, r27, r28, and r29 (Shadow Register Set number 1 to 7) are automatically saved so the user program doesn't have to save these. Refer to the separate volume "TX19A Core Architecture" for details of general purpose registers that are to be automatically saved. In general, registers other than GPR are dependent on user programs. The Status, EPC, SSCR, HI, LO, Cause, and Config values of the CP0 register shall be saved as appropriate. For using multiple interrupts, interrupts are enabled by clearing Status of the CP0 register to "0" after appropriate saving processes.
(Note 1)
Note that general exceptions can be accepted even when interrupts are disabled. So, even when you don't use multiple interrupts, it is desirable to save any general purpose register and the CP0 register that could be overwritten by general exceptions.
TMP19A43 (rev2.0) 6-21
Exceptions/Interrupts
TMP19A43
Example interrupt handler settings to be necessary: Save from SSCR to stack NOP instruction NOP instruction Save from EPC to stack Save from Status to stack NOP instruction NOP instruction Status = "0" ; Save SSCR values (as appropriate) ; Stall until SSCR is switched ; Stall until SSCR is switched ; Save EPC values (as appropriate) ; Save Status values (as appropriate) ; Stall before executing ERET instruction ; Stall before executing ERET instruction ; Interrupt enable (only for multiple interrupts)
(Note 1)
After overwriting SSCR of the CP0 register, wait for two cycles to allow for register bank switching before attempting a register access.
Returning from the interrupt handler For returning from the interrupt handler to the main process, return the register values saved at the top of the interrupt handler process and set "0" to INTC ILEV to clear the interrupt mask level. By executing the ERET instruction after all the return tasks are completed, Status of the CP0 register is cleared to "0" and the EPC address returns to PC for the main process to be resumed. If the shadow register set has been enabled (CP0 register SSCR = 0), SSCR is updated by the ERET instruction and the Shadow Register Set number is automatically decremented for automatically returning the general purpose registers saved in the register bank. If multiple interrupts are used, it is necessary to set Status of the CP0 register to "1" to disable interrupts prior to executing the return process. Example settings to return from the interrupt hander: Status = "1" ILEV = "0" SYNC instruction Return to SSCR NOP instruction NOP instruction Return to EPC Return to Status NOP instruction NOP instruction ERET instruction ; Interrupt disable (only for multiple interrupts) ; Decrement the mask level ; Stall until mask level is decremented ; Return SSCR values saved (as appropriate) ; Stall until SSCR is switched ; Stall until SSCR is switched ; Return SSCR values saved (as appropriate) ; Return Status values saved (as appropriate) ; Stall before executing ERET instruction ; Stall before executing ERET instruction ; Status = "0," EPC to PC, SSCR to SSCR
(Note 1) (Note 2)
After overwriting SSCR of the CP0 register, wait for two cycles to allow for register bank switching before attempting a register access. Don't access the CP0 register two instructions prior to executing the ERET instruction.
TMP19A43 (rev2.0) 6-22
Exceptions/Interrupts
TMP19A43
6.8.7
Example of Multiple Interrupt Setting
In "multiple interrupt" processing, a higher interrupt level interrupt is processed while an interrupt is being processed. With TMP19A43, multiple interrupts are processed through the interrupt priority arbitration function of INTC. When an interrupt request is accepted, ILEV of INTC is automatically updated to the interrupt level of the interrupt accepted to enable arbitration to use the priority preset by the user program. Additional processes required for multiple interrupts When an interrupt is accepted, Status of the CP0 register is set to "1" disabling further interrupts. In order to allow multiple interrupts, it is necessary to save the registers that could be overwritten by the second and the following interrupts before enabling the multiple interrupt process. For this purpose, in addition to the typical exception handler and interrupt handler processes, save the following registers before setting Status of the CP0 register to "0" to enable interrupts. CP0 registers that must be saved: * * * (Note 1) EPC SSCR Status Some of the registers may be automatically saved and returned by using some interrupt function of Toshiba C compiler. Refer to "TX19A C Compiler Reference" provided with the Toshiba C compiler for more details. Save the HI, LO, Cause, and Config registers as appropriate.
Additional return processes required for multiple interrupts Before returning registers in the interrupt return process, it is necessary to disable interrupts using the method described in Section 6.8.5.4 "Interrupt Disable." This is to prevent the returned register values from being corrupted by multiple interrupts. Note that the ERET instruction automatically clears Status of the CP0 register to "0." So, by setting Status of the CP0 register to "1" to disable interrupts in the returning process, you can return from the interrupt with interrupts enabled automatically. Proper use of Status and Status While there is no significant distinction between the Status and Status parameters, Status is automatically set to "1" upon interrupt generation and cleared to "0" by the ERET instruction automatically. In saving and returning register values at the initial and final phases of an interrupt process, where interrupts have to be disabled, hardware controlled Status is normally used. Status is used for other general interrupt enable/disable control functions. Applicable interrupt enable/disable control sequences are described in Section 6.8.7.1, "Interrupt Control for Multiple Interrupts."
TMP19A43 (rev2.0) 6-23
Exceptions/Interrupts
TMP19A43
6.8.7.1
Interrupt Control for Multiple Interrupts
Fig. 6-5 Interrupt Enable/Disable Control Sequence for Multiple Interrupts Status = 1 Interrupts can be enabled by setting Status of the CP0 register to "1" while Status is set to "0." This optional setting is made by the software program when it is necessary. Interrupt Generation When an interrupt is generated, Status of the CP0 register is set to "1" disabling further interrupts. This process is automatically performed by hardware. Status = 0 If multiple interrupts are to be enabled, it is necessary to set Status of the CP0 register to "0" to enable interrupts after relevant registers are saved. If interrupts are enabled before saving registers, a higher priority level interrupt could corrupt the register data. This optional setting is made by the software program when it is necessary. Multiple Interrupts Enabled This is the period multiple interrupts are enabled. Interrupts with a level higher than the present interrupt level (ILEV ) are to be accepted. If it is desired to disable interrupts during this period, set Status of the CP0 register to "0." Status = 1 If multiple interrupts are enabled, it is necessary to set Status of the CP0 register to "1" to disable interrupts before returning relevant register values. If registers are saved before disabling interrupts, a higher priority level interrupt could corrupt the register data. This optional setting is made by the software program when it is necessary. ERET Instruction This instruction returns the system to the state before the interrupt generation. If this instruction is executed while Status of the CP0 register is set to "1," the Status will be automatically set to "0" and interrupt is enabled (provided that Status of the CP0 register is set to "1"). Status=0 Interrupts can be disabled by setting Status of the CP0 register to "0." This optional setting is made by the software program when it is necessary.
TMP19A43 (rev2.0) 6-24
Exceptions/Interrupts
TMP19A43
6.8.8
6.8.8.1
Registers
Register Map Table 6.8.5 INTC Register Map
Address 0xFFFF_E000 0xFFFF_E004 0xFFFF_E008 0xFFFF_E00C 0xFFFF_E010 0xFFFF_E014 0xFFFF_E018 0xFFFF_E01C 0xFFFF_E020 0xFFFF_E024 0xFFFF_E028 0xFFFF_E02C 0xFFFF_E030 0xFFFF_E034 0xFFFF_E038 0xFFFF_E03C 0xFFFF_E040 0xFFFF_E060 0xFFFF_E10C
Register symbol IMC0 IMC1 IMC2 IMC3 IMC4 IMC5 IMC6 IMC7 IMC8 IMC9 IMCA IMCB IMCC IMCD IMCE IMCF IVR INTCLR ILEV
Register Interrupt mode control register 00 Interrupt mode control register 04 Interrupt mode control register 08 Interrupt mode control register 12 Interrupt mode control register 16 Interrupt mode control register 20 Interrupt mode control register 24 Interrupt mode control register 28 Interrupt mode control register 32 Interrupt mode control register 36 Interrupt mode control register 40 Interrupt mode control register 44 Interrupt mode control register 48 Interrupt mode control register 52 Interrupt mode control register 56 Interrupt mode control register 60 Interrupt vector register Interrupt request clear register Interrupt mask level register
Corresponding interrupt number 0 to 3 4 to 7 8 to 11 12 to 15 16 to 19 20 to 23 24 to 27 28 to 31 32 to 35 36 to 39 40 to 43 44 to 47 48 to 51 52 to 55 56 to 9 60 to 63
(Note 1)
While the interrupt mode control register (IMCxx) is a 32 bit register, 8 bit/16 bit access is also accepted.
TMP19A43 (rev2.0) 6-25
Exceptions/Interrupts
TMP19A43
6.8.8.2
Interrupt Vector Registers (IVR)
For an interrupt generated, the IVR register indicates the interrupt vector address of the corresponding interrupt factor. When an interrupt request is accepted, the corresponding value as listed in Table 6.8.1 is set to IVR [7:0]. By setting the base address of interrupt vectors to IVR [31:8], a read/write register, simply reading the IVR value can provide the corresponding interrupt vector address. Table 6.8.6 Interrupt Vector Register
IVR (0xFFFF_E040) bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function 7 IVR7 0 15 IVR15 0 23 IVR23 0 31 IVR31 0 6 IVR6 5 IVR5 4 IVR4 3 IVR3 2 IVR2 0 10 IVR10 0 18 IVR18 0 26 IVR26 0 1 IVR1 0 IVR0
R 0 0 0 0 The vector of the interrupt factor generated is set. 14 13 12 11 IVR14 IVR13 IVR12 IVR11 R/W 0 0 0 0 22 IVR22 0 30 IVR30 0 21 IVR21 0 29 IVR29 0 20 IVR20 R/W 0 28 IVR28 R/W 0 0 0 27 IVR27 19 IVR19
0 0 Always reads "0." 9 8 IVR9 IVR8 R 0 0 17 IVR17 0 25 IVR25 0 16 IVR16 0 24 IVR24 0
TMP19A43 (rev2.0) 6-26
Exceptions/Interrupts
TMP19A43
6.8.8.3
Interrupt Level Register (ILEV)
ILEV is the register to control the interrupt level to be used by INTC in notifying interrupt requests to the TX19A processor core. Interrupts with interrupt levels not higher than ILEV are suspended. The interrupt priority level "7" is the highest priority and "1" the lowest. Note that any interrupt with interrupt level 0 is not suspended. When a new interrupt is generated, the corresponding interrupt level is stored in and any previously stored values are incremented in mask levels such that the previous CMASK is saved in PMASK0 and PMASK0 is saved in PMASK1 and so on. For writing a new value to , set "1" to and write simultaneously. Writing a new value to cannot be made. When is set to "0," the interrupt mask levels in the register shift back to the previous state such that PMASK0 is moved to CMASK and PMASK1 is moved to PMASK0, and so on. The last is set to "000." If it is used in returning from an interrupt process, be sure to set to "0" before executing the ERET instruction. always reads "0." Table 6.8.7 Interrupt Level Register
ILEV (0xFFFF_E10C) bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function 7 0 15 0 23 0 31 MLEV W 0 0: Return mask level 1: Change CMASK 5 4 PMASK0 R 000 Interrupt mask level (previous) 0 14 13 12 PMASK2 R 000 Interrupt mask level (previous) 2 22 21 20 PMASK4 R 000 Interrupt mask level (previous) 4 30 29 28 PMASK6 000 Interrupt mask level (previous) 6 0 27 R 0 000 Interrupt mask level (previous) 3 26 25 24 PMASK5 000 Interrupt mask level (previous) 5 0 19 000 Interrupt mask level (previous) 1 18 17 16 PMASK3 6 3 0 11 1 0 CMASK R/W 000 Interrupt mask level (current) 10 9 8 PMASK1 2
(Note 1) (Note 2) (Note 3)
PMASK6
This register must be 32-bit accessed. Be sure to read the IVR value before changing the ILEV value. If the ILEV value is changed before reading IVR, an unexpected interrupt request may be generated. Bit manipulation instructions cannot be used to access this register.
PMASK5 PMASK4 PMASK3 PMASK2 PMASK1 PMASK0 CMASK New interrupt level
Interrupt generation
PMASK6 "000" PMASK6 =0
PMASK5
PMASK4
PMASK3
PMASK2
PMASK1
PMASK0
CMASK
PMASK5
PMASK4
PMASK3
PMASK2
PMASK1
PMASK0
CMASK
TMP19A43 (rev2.0) 6-27
Exceptions/Interrupts
TMP19A43
6.8.8.4
Interrupt Mode Control Registers (IMCxx)
IMCxx is comprised of , which determines the interrupt levels of individual interrupt factors, , which is used to set activation factors of DMA transfer, and , which determines active state of interrupt requests.
7 IMC0 bit Symbol (0xFFFF_E000) Read/Write After reset Function R 0 Always reads "0." 5 EIM00 R/W 0 0 Selects active state of interrupt request: 00: "L" level 01: Disable 10: Disable 11: Disable Be sure to set "00." 6 EIM01 4 DM0 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 0 is set as the activation factor
3 R 0 Always reads "0."
2 IL02
0 0 If DM0 = 0, select the interrupt level for interrupt number 0 (software set). 000: Disable Interrupt 001 to 111: 1 to 7 If DM0 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 IL01 R/W 0
0 IL00
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM10 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
14 EIM11
12 DM1 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 1 to be the activation factor.
11 R 0 Always reads "0."
10 IL12
0 0 If DM1 = 0, select the interrupt level for interrupt number 1 (INT0). 000: Disable Interrupt 001 to 111: 1 to 7 If DM1 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL22 17 IL21 R/W 0 16 IL20
9 IL11 R/W 0
8 IL10
Standby setting "01" 23 bit Symbol Read/Write After reset Function R 0 Always reads "0." 21 EIM20 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge Standby setting "01" 31 bit Symbol Read/Write After reset Function R 0 Always reads "0." 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge Standby setting "01" 30 EIM31 29 EIM30 22 EIM21
20 DM2 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 2 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM2 = 0, select the interrupt level for interrupt number 2 (INT1). 000: Disable Interrupt 001 to 111: 1 to 7 If DM2 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL32 R 25 IL31 24 IL30
28 DM3 R/W 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 3 to be the activation factor.
27
0 Always reads "0."
R/W 0 0 0 If DM3 = 0, select the interrupt level for interrupt number 3 (INT2). 000: Disable Interrupt 001 to 111: 1 to 7 If DM3 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
TMP19A43 (rev2.0) 6-28
Exceptions/Interrupts
TMP19A43
7 IMC1 (0xFFFF_E004) bit Symbol Read/Write After reset Function R 0 Always reads "0."
5 EIM40 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
6 EIM41
4 DM4 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 4 is set as the activation factor
3 R 0 Always reads "0."
2 IL42
0 0 If DM4 = 0, select the interrupt level for interrupt number 4 (INT3) 000: Disable Interrupt 001 to 111: 1 to 7 If DM4 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 IL41 R/W 0
0 IL40
Standby setting "01"
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM50 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
14 EIM51
12 DM5 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 5 to be the activation factor.
11 R 0 Always reads "0."
10 IL52
0 0 If DM5 = 0, select the interrupt level for interrupt number 5 (INT4). 000: Disable Interrupt 001 to 111: 1 to 7 If DM5 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL62 17 IL61 R/W 0 16 IL60
9 IL51 R/W 0
8 IL50
Standby setting "01" 23 bit Symbol Read/Write After reset Function R 0 Always reads "0." 21 EIM60 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge 22 EIM61
20 DM6 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 6 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM6 = 0, select the interrupt level for interrupt number 6 (INT5). 000: Disable Interrupt 001 to 111: 1 to 7 If DM6 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL72 25 IL71 R/W 0 24 IL70
Standby setting "01" 31 bit Symbol Read/Write After reset Function R 0 Always reads "0." 29 EIM70 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge 30 EIM71
28 DM7 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 7 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DM7 = 0, select the interrupt level for interrupt number 7 (INT6). 000: Disable Interrupt 001 to 111: 1 to 7 If DM7 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Standby setting "01"
TMP19A43 (rev2.0) 6-29
Exceptions/Interrupts
TMP19A43
7 IMC2 bit Symbol (0xFFFF_E008) Read/Write After reset Function R 0 Always reads "0."
5 EIM80 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
6 EIM81
4 DM8 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 8 is set as the activation factor
3 R 0 Always reads "0."
2 IL82
0 0 If DM8 = 0, select the interrupt level for interrupt number 8 (INT7). 000: Disable Interrupt 001 to 111: 1 to 7 If DM8 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 IL81 R/W 0
0 IL80
Standby setting "01"
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM90 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
14 EIM91
12 DM9 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 9 to be the activation factor.
11 R 0 Always reads "0."
10 IL92
0 0 If DM9 = 0, select the interrupt level for interrupt number 9 (INT8). 000: Disable Interrupt 001 to 111: 1 to 7 If DM9 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 ILA2 17 ILA1 R/W 0 16 ILA0
9 IL91 R/W 0
8 IL90
Standby setting "01" 23 bit Symbol Read/Write After reset Function R 0 Always reads "0." 21 EIMA0 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge 22 EIMA1
20 DMA 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 10 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DMA = 0, select the interrupt level for interrupt number 10 (INT9). 000: Disable Interrupt 001 to 111: 1 to 7 If DMA = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 ILB2 25 ILB1 R/W 0 24 ILB0
Standby setting "01" 31 bit Symbol Read/Write After reset Function R 0 Always reads "0." 29 EIMB0 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge 30 EIMB1
28 DMB 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 11 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DMB = 0, select the interrupt level for interrupt number 11 (INTA) 000: Disable Interrupt 001 to 111: 1 to 7 If DMB = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Standby setting "01"
TMP19A43 (rev2.0) 6-30
Exceptions/Interrupts
TMP19A43
7 IMC3 bit Symbol (0xFFFF_E00C) Read/Write After reset Function R 0 Always reads "0."
5 EIMC0 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
6 EIMC1
4 DMC 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 12 is set as the activation factor
3 R 0 Always reads "0."
2 ILC2
0 0 If DMC = 0, select the interrupt level for interrupt number 12 (INTB) 000: Disable Interrupt 001 to 111: 1 to 7 If DMC = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 ILC1 R/W 0
0 ILC0
Standby setting "01"
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIMD0 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
14 EIMD1
12 DMD 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 13 to be the activation factor.
11 R 0 Always reads "0."
10 ILD2
0 0 If DMD = 0, select the interrupt level for interrupt number 13 (INTC) 000: Disable Interrupt 001 to 111: 1 to 7 If DMD = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 ILE2 17 ILE1 R/W 0 16 ILE0
9 ILD1 R/W 0
8 ILD0
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIME0 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
22 EIME1
20 DME 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 14 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DME = 0, select the interrupt level for interrupt number 14 (INTD) 000: Disable Interrupt 001 to 111: 1 to 7 If DME = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 ILF2 25 ILF1 R/W 0 24 ILF0
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIMF0 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
30 EIMF1
28 DMF 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 15 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DMF = 0, select the interrupt level for interrupt number 15 (INTE) 000: Disable Interrupt 001 to 111: 1 to 7 If DMF = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
TMP19A43 (rev2.0) 6-31
Exceptions/Interrupts
TMP19A43
7 IMC4 (0xFFFF_E010) bit Symbol Read/Write After reset Function R 0 Always reads "0."
5 EIM100 R/W 0 0 Selects active state of interrupt request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge
6 EIM101
4 DM10 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 16 is set as the activation factor
3 R 0 Always reads "0."
2 IL102
0 0 If DM10 = 0, select the interrupt level for interrupt number 16 (INTF) 000: Disable Interrupt 001 to 111: 1 to 7 If DM10 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 IL101 R/W 0
0 IL100
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM110 R/W 0 0 Selects active state of interrupt request. 01: "H" level Be sure to set "01."
14 EIM111
12 DM11 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 17 to be the activation factor.
11 R 0 Always reads "0."
10 IL112
0 0 If DM11 = 0, select the interrupt level for interrupt number 17 (KWUP) 000: Disable Interrupt 001 to 111: 1 to 7 If DM11 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL122 17 IL121 R/W 0 16 IL120
9 IL111 R/W 0
8 IL110
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM120 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM121
20 DM12 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 18 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM12 = 0, select the interrupt level for interrupt number 18 (INTRX0). 000: Disable Interrupt 001 to 111: 1 to 7 If DM12 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL132 25 IL131 R/W 0 24 IL130
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM130 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
30 EIM131
28 DM13 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 19 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DM13 = 0, select the interrupt level for interrupt number 19 (INTTX0) 000: Disable Interrupt 001 to 111: 1 to 7 If DM13 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-32
Exceptions/Interrupts
TMP19A43
7 IMC5 bit Symbol (0xFFFF_E014) Read/Write After reset Function R 0 Always reads "0."
5 EIM140 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
6 EIM141
4 DM14 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 20 is set as the activation factor
3 R 0 Always reads "0."
2 IL142
0 0 If DM14 = 0, select the interrupt level for interrupt number 20 (INTRX1). 000: Disable Interrupt 001 to 111: 1 to 7 If DM14 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 IL141 R/W 0
0 IL140
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM150 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
14 EIM151
12 DM15 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 21 to be the activation factor.
11 R 0 Always reads "0."
10 IL152
0 0 If DM15 = 0, select the interrupt level for interrupt number 21 (INTTX1) 000: Disable Interrupt 001 to 111: 1 to 7 If DM15 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL162 17 IL161 R/W 0 16 IL160
9 IL151 R/W 0
8 IL150
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM160 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM161
20 DM16 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 22 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM16 = 0, select the interrupt level for interrupt number 22 (INTRX2). 000: Disable Interrupt 001 to 111: 1 to 7 If DM16 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL172 25 IL171 R/W 0 24 IL170
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM170 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
30 EIM171
28 DM17 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 23 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DM17 = 0, select the interrupt level for interrupt number 23 (INTTX2). 000: Disable Interrupt 001 to 111: 1 to 7 If DM17 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-33
Exceptions/Interrupts
TMP19A43
7 IMC6 (0xFFFF_E018) bit Symbol Read/Write After reset Function R 0 Always reads "0."
5 EIM180 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
6 EIM181
4 DM18 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 24 is set as the activation factor
3 R 0 Always reads "0."
2 IL182
0 0 If DM18 = 0, select the interrupt level for interrupt number 24 (INTRX3). 000: Disable Interrupt 001 to 111: 1 to 7 If DM18 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 IL181 R/W 0
0 IL180
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM190 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
14 EIM191
12 DM19 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 25 to be the activation factor.
11 R 0 Always reads "0."
10 IL192
0 0 If DM19 = 0, select the interrupt level for interrupt number 25 (INTTX3). 000: Disable Interrupt 001 to 111: 1 to 7 If DM19 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
9 IL191 R/W 0
8 IL190
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM1A0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM1A1
20 DM1A 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 26 to be the activation factor.
19 R 0 Always reads "0."
18 IL1A2
0 0 If DM1A = 0, select the interrupt level for interrupt number 26 (INTRX4). 000: Disable Interrupt 001 to 111: 1 to 7 If DM1A = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
17 IL1A1 R/W 0
16 IL1A0
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM1B0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
30 EIM1B1
28 DM1B 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 27 to be the activation factor.
27 R 0 Always reads "0."
26 IL1B2
0 0 If DM1B = 0, select the interrupt level for interrupt number 27 (INTTX4). 000: Disable Interrupt 001 to 111: 1 to 7 If DM1B = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
25 IL1B1 R/W 0
24 IL1B0
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use. TMP19A43 (rev2.0) 6-34 Exceptions/Interrupts
TMP19A43
7 IMC7 (0xFFFF_E01C) bit Symbol Read/Write After reset Function R 0 Always reads "0."
6 EIM1C1
5
4 DM1C 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 28 to be the activation factor.
3 R 0 Always reads "0."
2 IL1C2
1 IL1C1 R/W 0
0 IL1C0
EIM1C0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
0 0 If DM1C = 0, select the interrupt level for interrupt number 28 (INTRX5). 000: Disable Interrupt 001 to 111: 1 to 7 If DM1C = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 10 IL1D2 9 IL1D1 R/W 0 8 IL1D0
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM1D0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
14 EIM1D1
12 DM1D 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 29 to be the activation factor.
11 R 0 Always reads "0."
0 0 If DM1D = 0, select the interrupt level for interrupt number 29 (INTTX5). 000: Disable Interrupt 001 to 111: 1 to 7 If DM1D = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL1E2 17 IL1E1 R/W 0 16 IL1E0
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM1E0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM1E1
20 DM1E 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 30 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM1E = 0, select the interrupt level for interrupt number 30 (INTS0). 000: Disable Interrupt 001 to 111: 1 to 7 If DM1E = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL1F2 25 IL1F1 R/W 0 24 IL1F0
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM1F0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
30 EIM1F1
28 DM1F 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 31 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DM1F = 0, select the interrupt level for interrupt number 31 (INTADHP) 000: Disable Interrupt 001 to 111: 1 to 7 If DM1F = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-35
Exceptions/Interrupts
TMP19A43
7 IMC8 (0xFFFF_E020) bit Symbol Read/Write After reset Function R 0 Always reads "0."
5 EIM200 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
6 EIM201
4 DM20 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 32 to be the activation factor.
3 R 0 Always reads "0."
2 IL202
0 0 If DM20 = 0, select the interrupt level for interrupt number 32 (INTADM) 000: Disable Interrupt 001 to 111: 1 to 7 If DM20 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 10 IL212 9 IL211 R/W 0 8 IL210
1 IL201 R/W 0
0 IL200
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM210 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
14 EIM211
12 DM21 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 33 to be the activation factor.
11 R 0 Always reads "0."
0 0 If DM21 = 0, select the interrupt level for interrupt number 33 (INTTB0). 000: Disable Interrupt 001 to 111: 1 to 7 If DM21 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL222 17 IL221 R/W 0 16 IL220
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM220 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM221
20 DM26 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 34 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM22 = 0, select the interrupt level for interrupt number 34 (INTTB1). 000: Disable Interrupt 001 to 111: 1 to 7 If DM22 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL232 25 IL231 R/W 0 24 IL230
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM230 R/W 0 0 Selects active state of interrupt request.
30 EIM231
28 DM23 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 35 to be the activation factor.
27 R 0 Always reads "0."
11: Rising edge Be sure to set "11."
Standby setting "01"
0 0 If DM23 = 0, select the interrupt level for interrupt number 35 (INTTB2) 000: Disable Interrupt 001 to 111: 1 to 7 If DM23 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-36
Exceptions/Interrupts
TMP19A43
7 IMC9 (0xFFFF_E024) bit Symbol Read/Write After reset Function R 0 Always reads "0."
5 EIM240 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
6 EIM241
4 DM24 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 36 to be the activation factor.
3 R 0 Always reads "0."
2 IL242
Standby setting "01"
0 0 If DM24 = 0, select the interrupt level for interrupt number 36 (INTTB3). 000: Disable Interrupt 001 to 111: 1 to 7 If DM24 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 10 IL252 9 IL251 R/W 0 8 IL250
1 IL241 R/W 0
0 IL240
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM250 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
14 EIM251
12 DM25 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 37 to be the activation factor.
11 R 0 Always reads "0."
0 0 If DM25 = 0, select the interrupt level for interrupt number 37 (INTTB4). 000: Disable Interrupt 001 to 111: 1 to 7 If DM25 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL262 17 IL261 R/W 0 16 IL260
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM260 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM261
20 DM26 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 38 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM26 = 0, select the interrupt level for interrupt number 38 (INTTB5). 000: Disable Interrupt 001 to 111: 1 to 7 If DM26 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL272 25 IL271 R/W 0 24 IL270
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM270 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
30 EIM271
28 DM27 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 39 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DM27 = 0, select the interrupt level for interrupt number 39 (INTTB6). 000: Disable Interrupt 001 to 111: 1 to 7 If DM27 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-37
Exceptions/Interrupts
TMP19A43
7 IMCA bit Symbol (0xFFFF_E028) Read/Write After reset Function R 0 Always reads "0."
5 EIM280 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
6 EIM281
4 DM28 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 40 to be the activation factor.
3 R 0 Always reads "0."
2 IL282
0 0 If DM28 = 0, select the interrupt level for interrupt number 40 (INTTB7). 000: Disable Interrupt 001 to 111: 1 to 7 If DM28 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 10 IL292 9 IL291 R/W 0 8 IL290
1 IL281 R/W 0
0 IL280
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM290 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
14 EIM291
12 DM29 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 41 to be the activation factor.
11 R 0 Always reads "0."
0 0 If DM29 = 0, select the interrupt level for interrupt number 41 (INTTB8). 000: Disable Interrupt 001 to 111: 1 to 7 If DM29 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL2A2 17 IL2A1 R/W 0 16 IL2A0
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM2A0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM2A1
20 DM2A 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 42 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM2A = 0, select the interrupt level for interrupt number 42 (INTTB9). 000: Disable Interrupt 001 to 111: 1 to 7 If DM2A = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL2B2 25 IL2B1 R/W 0 24 IL2B0
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM2B0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
30 EIM2B1
28 DM2B 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 43 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DM2B = 0, select the interrupt level for interrupt number 43 (INTTBA). 000: Disable Interrupt 001 to 111: 1 to 7 If DM2B = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-38
Exceptions/Interrupts
TMP19A43
7 IMCB bit Symbol (0xFFFF_E02C) Read/Write After reset Function R 0 Always reads "0."
5 EIM2C0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
6 EIM2C1
4 DM2C 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 44 to be the activation factor.
3 R 0 Always reads "0."
2 IL2C2
0 0 If DM2C = 0, select the interrupt level for interrupt number 44 (INTTBB). 000: Disable Interrupt 001 to 111: 1 to 7 If DM2C = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 10 IL2D2 9 IL2D1 R/W 0 8 IL2D0
1 IL2C1 R/W 0
0 IL2C0
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM2D0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
14 EIM2D1
12 DM2D 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 45 to be the activation factor.
11 R 0 Always reads "0."
0 0 If DM2D = 0, select the interrupt level for interrupt number 45 (INTTBC). 000: Disable Interrupt 001 to 111: 1 to 7 If DM2D = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 IL2E2 17 IL2E1 R/W 0 16 IL2E0
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM2E0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM2E1
20 DM2E 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 46 to be the activation factor.
19 R 0 Always reads "0."
0 0 If DM2E = 0, select the interrupt level for interrupt number 46 (INTTBD). 000: Disable Interrupt 001 to 111: 1 to 7 If DM2E = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 26 IL2F2 25 IL2F1 R/W 0 24 IL2F0
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM2F0 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
30 EIM2F1
28 DM2F 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 47 to be the activation factor.
27 R 0 Always reads "0."
0 0 If DM2F = 0, select the interrupt level for interrupt number 47 (INTTBE). 000: Disable Interrupt 001 to 111: 1 to 7 If DM2F = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-39
Exceptions/Interrupts
TMP19A43
7 IMCC bit Symbol (0xFFFF_E030) Read/Write After reset Function R 0 Always reads "0."
5 EIM300 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
6 EIM301
4 DM30 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 48 to be the activation factor.
3 R 0 Always reads "0."
2 IL302
0 0 If DM30 = 0, select the interrupt level for interrupt number 48 (INTTBF). 000: Disable Interrupt 001 to 111: 1 to 7 If DM30 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 10 IL312 9 IL311 R/W 0 8 IL310
1 IL301 R/W 0
0 IL300
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM310 R/W 0 0 Selects active state of interrupt request. 1: Rising edge Be sure to set "11."
14 EIM311
12 DM31 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 49 to be the activation factor.
11 R 0 Always reads "0."
0 0 If DM31 = 0, select the interrupt level for interrupt number 49 (INTCAPG0) 000: Disable Interrupt 001 to 111: 1 to 7 If DM31 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7 18 17 16
23 bit Symbol Read/Write After reset Function
22
21
20 R
19
0 0 Always reads "0." 31 30 EIM331
0
0
0
0
0
0
bit Symbol Read/Write After reset Function
R 0 Always reads "0."
29 EIM330 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
28 DM33 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 51 to be the activation factor.
27 R 0 Always reads "0."
26 IL332
0 0 If DM33 = 0, select the interrupt level for interrupt number 51 (INTCMP0) 000: Disable Interrupt 001 to 111: 1 to 7 If DM33 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
25 IL331 R/W 0
24 IL330
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-40
Exceptions/Interrupts
TMP19A43
7 IMCD bit Symbol (0xFFFF_E034) Read/Write After reset Function R 0 Always reads "0."
5 EIM340 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
6 EIM341
4 DM34 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 52 to be the activation factor.
3 R 0 Always reads "0."
2 IL342
1 IL341 R/W 0
0 IL340
If DM34 = 0, select the interrupt level for interrupt number 52 (INTCMP1) 000: Disable Interrupt 001 to 111: 1 to 7 If DM34 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM350 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
14 EIM351
12 DM35 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 53 to be the activation factor.
11 R 0 Always reads "0."
10 IL352
0 0 If DM35 = 0, select the interrupt level for interrupt number 53 (INTCMP2) 000: Disable Interrupt 001 to 111: 1 to 7 If DM35 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
9 IL351 R/W 0
8 IL350
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM360 R/W 0 0 Selects active state of interrupt request. 11: Rising edge Be sure to set "11."
22 EIM361
20 DM36 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 54 to be the activation factor.
19 R 0 Always reads "0."
18 IL362
0 0 If DM36 = 0, select the interrupt level for interrupt number 54 (INTCMP3) 000: Disable Interrupt 001 to 111: 1 to 7 If DM36 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
17 IL361 R/W 0
16 IL360
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM370 R/W 0 0 Selects active state of interrupt request.
30 EIM371
28 DM37 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 55 to be the activation factor.
27 R 0 Always reads "0."
26 IL372
11: Rising edge Be sure to set "11."
0 0 If DM37 = 0, select the interrupt level for interrupt number 55 (INTCMP4) 000: Disable Interrupt 001 to 111: 1 to 7 If DM37 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
25 IL371 R/W 0
24 IL370
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-41
Exceptions/Interrupts
TMP19A43
7 IMCE bit Symbol (0xFFFF_E038) Read/Write After reset Function R 0 Always reads "0."
5 EIM380 R/W 0 0 Selects active state of interrupt requet.
6 EIM381
4 DM38 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 56 to be the activation factor.
3 R 0 Always reads "0."
2 IL382
11: Rising edge Be sure to set "11."
0 0 If DM38 = 0, select the interrupt level for interrupt number 56 (INTCMP5) 000: Disable Interrupt 001 to 111: 1 to 7 If DM38 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 IL381 R/W 0
0 IL380
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM390 R/W 0 0 Selects active state of interrupt request.
14 EIM391
12 DM39 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 57 to be the activation factor.
11 R 0 Always reads "0."
10 IL392
11: Rising edge Be sure to set "11."
0 0 If DM39 = 0, select the interrupt level for interrupt number 57 (INTCMP6) 000: Disable Interrupt 001 to 111: 1 to 7 If DM39 = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
9 IL391 R/W 0
8 IL390
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM3A0 R/W 0 0 Selects active state of interrupt request.
22 EIM3A1
20 DM3A 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 58 to be the activation factor.
19 R 0 Always reads "0."
18 IL3A2
11: Rising edge Be sure to set "11."
0 0 If DM3A = 0, select the interrupt level for interrupt number 58 (INTCMP7) 000: Disable Interrupt 001 to 111: 1 to 7 If DM3A = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
17 IL3A1 R/W 0
16 IL3A0
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM3B0 R/W 0 0 Selects active state of interrupt request.
30 EIM3B1
28 DM3B 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 59 to be the activation factor.
27 R 0 Always reads "0."
26 IL3B2
10: Falling edge Be sure to set "10."
0 0 If DM3B = 0, select the interrupt level for interrupt number 59 (INTTBT). 000: Disable Interrupt 001 to 111: 1 to 7 If DM3B = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
25 IL3B1 R/W 0
24 IL3B0
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-42
Exceptions/Interrupts
TMP19A43
7 IMCF bit Symbol (0xFFFF_E03C) Read/Write After reset Function R 0 Always reads "0."
5 EIM3C0 R/W 0 0 Selects active state of interrupt request.
6 EIM3C1
4 DM3C 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 60 to be the activation factor.
3 R 0 Always reads "0."
2 IL3C2
10: Falling edge Be sure to set "10."
Standby setting "01"
0 0 If DM3C = 0, select the interrupt level for interrupt number 60 (INTRTC) 000: Disable Interrupt 001 to 111: 1 to 7 If DM3C = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
1 IL3C1 R/W 0
0 IL3C0
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
13 EIM3D0 R/W 0 0 Selects active state of interrupt request.
14 EIM3D1
12 DM3D 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 61 to be the activation factor.
11 R 0 Always reads "0."
10 IL3D2
11: Rising edge Be sure to set "11."
0 0 If DM3D = 0, select the interrupt level for interrupt number 61 (INTAD) 000: Disable Interrupt 001 to 111: 1 to 7 If DM3D = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: 4 to 7
9 IL3D1 R/W 0
8 IL3D0
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
21 EIM3E0 R/W 0 0 Selects active state of interrupt request. 00: "L" level Be sure to set "00.".
22 EIM3E1
20 DM3E 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 62 to be the activation factor.
19 R 0 Always reads "0."
18 IL3E2
0 0 If DM3E = 0, select the interrupt level for interrupt number 62 (INTDMA0-3). 000: Disable Interrupt 001 to 111: 1 to 7 If DM3E = 1, select the DMAC channel. 000 to 011:--100 to 111: 4 to 7
17 IL3E1 R/W 0
16 IL3E0
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
29 EIM3F0 R/W 0 0 Selects active state of interrupt request. 00: "L" level Be sure to set "00."
30 EIM3F1
28 DM3F 0 Set as DMAC activation factor.
0: Nonactivation factor 1: Interrupt number 63 to be the activation factor.
27 R 0 Always reads "0."
26 IL3F2
0 0 If DM3F = 0, select the interrupt level for interrupt number 63 (INTDMA4-7). 000: Disable Interrupt 001 to 111: 1 to 7 If DM3F = 1, select the DMAC channel. 000 to 011: 0 to 3 100 to 111: ---
25 IL3F1 R/W 0
24 IL3F0
Note:
Default values of EIMxx0 and EIMxx1 are different from the values to be used. Properly set them to the specified values before use. The access to the DMAC register by DMAC is a prohibition. TMP19A43 (rev2.0) 6-43 Exceptions/Interrupts
TMP19A43
Note 1: Please ensure that the type of active state is selected before enabling an interrupt request. Note 2: When making interrupt requests DMAC activation factors, please ensure that you put the DMAC into standby mode after setting the INTC. Note 3: When you change an active condition (when changing to the level detection)Please change after putting the interrupt output of the corresponding device into the state of Deasart. (1) Don't IL="0 setting IL="0" (2) Change (4) IL Detection condition (EIM) (3) INTCLR Pertinent interrupt is clear. It sets it to "Excluding 0". 6.8.8.5 Interrupt Request Clear Registers (INTCLR)
When it is desired to clear any interrupt request being suspended, you can do so by setting the IVR [7:0] for the corresponding interrupt factor into the INTCLR register. When an interrupt request is cleared, the IVR value is also cleared and the interrupt factor cannot be determined anymore. Do not clear an interrupt request before reading the IVR value. Table 6.8.8 Set the IVR value that corresponds to the interrupt request that you would like to clear
INTCLR (0xFFFF_E060) bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function 23 bit Symbol Read/Write After reset Function 31 bit Symbol Read/Write After reset Function 30 29 22 21 7 EICLR7 6 EICLR6 5 EICLR5 4 EICLR4 3 EICLR3 2 EICLR2 1 EICLR1 0 EICLR0
R/W 0 0 0 0 0 0 0 0 Set the IVR value that corresponds to the interrupt request that you would like to clear. 15 14 13 12 11 10 9 8 R 0 Always reads "0." 20 19 R 0 Always reads "0." 28 27 R 0 Always reads "0."
18
17
16
26
25
24
(Note 1) (Note 2)
This register must be 16-bit accessed. In order to maintain interrupt factors regardless of the active state setting of INTC IMCx , i.e., either "H" level, "L" level, rising edge, or falling edge, clear the interrupt request. Bit manipulation instructions cannot be used to access this register. External transfer requests due to DMAC interrupt factors are not cleared. Once an external transfer request is accepted, it will not be canceled until the DMA transfer is executed. Therefore, any unnecessary external transfer request should be cleared by executing DMA transfer. Otherwise, such an unnecessary external transfer request should not be accepted by disabling interrupts using IMCx or by canceling the corresponding DMAC activation factors using IMCx before accepting such external transfer requests. TMP19A43 (rev2.0) 6-44 Exceptions/Interrupts
(Note 3) (Note 4)
TMP19A43
CG
Detection circuit 2 WDT Write Bus Error
INTC
Active H level
1647
Set H/L level Both edges or edge
12
INT0-B
IMCxx register 163
Rising edge Rising edge
2
INTTB2,3
1
RTC
Core 1 Status register 16 "H" level
16 INTnEN Standby clear control
IMCGxx register
Other interrupts
KWUP Set H/L level or edge Input enable/disable for each interrupt factor KWUP KWUP0-31 register
KWUP0-31
Fig. 6-6 Interrupt Connection Diagram
TMP19A43 (rev2.0) 6-45
Exceptions/Interrupts
TMP19A43
6.9
INTCG Registers (Interrupts to Clear STOP, SLEEP, and IDLE)
INT0 to INTB, KWUP0 to 31 (Interrupts to Clear Stop, Sleep, and Idle modes) INTRTC, INTTB2, 3 (Two-phase pulse input counter): Sleep
7 5 4 EMCG01 EMCG00 R/W 0 1 0 Set active state of INT0 standby clear request. 000: "L" level 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 13 12 EMCG11 EMCG10 R/W 0 1 0 Set active state of INT1 standby clear request. 000: "L" level 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 21 20 EMCG21 EMCG20 R/W 0 1 0 Set active state of INT2 standby clear request. 000: "L" level 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 29 28 EMCG31 EMCG30 R/W 0 1 0 Set active state of INT3 standby clear request. 000: "L" level 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 30 EMCG32 22 EMCG22 14 EMCG12 6 EMCG02 3 EMST01 2 EMST00 1 R 0 Always reads "0." 0 INT0EN R/W 0 INT0 Clear input 0: Disable 1: Enable 9 R 0 Always reads "0." 8 INT1EN R/W 0 INT1 Clear input 0: Disable 1: Enable 17 R 0 Always reads "0." 16 INT2EN R/W 0 INT2 Clear input 0: Disable 1: Enable 25 R 0 Always reads "0." 24 INT3EN R/W 0 INT3 Clear input 0: Disable 1: Enable
IMCGA (0xFFFF_EE10)
bit Symbol Read/Write After reset Function
R 0 Always reads "0."
R 0 0 Active status of INT0 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges 11 10 EMST11 EMST10 R 0 0 Active status of INT1 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges 19 18 EMST21 EMST20 R 0 0 Active status of INT2 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges 27 26 EMST31 EMST30 R 0 0 Active status of INT3 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
TMP19A43 (rev2.0) 6-46
Exceptions/Interrupts
TMP19A43
7 IMCGB (0xFFFF_EE14) bit Symbol Read/Write After reset Function R 0 Always reads "0."
5 4 EMCG41 EMCG40 R/W 0 1 0 Set active state of INT4 standby clear request. 000: "L" level 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 13 12 EMCG51 EMCG50 R/W 0 1 0 Set active state of INT5 standby clear request. 000: "L" level 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 21 20 EMCG61 EMCG60 R/W 0 1 0 Set active state of INT6 standby clear request. 000: "L" level 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 29 28 EMCG71 EMCG70 R/W 0 1 0 Set active state of INT7 standby clear request. 000: "L" level 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 30 EMCG72 22 EMCG62 14 EMCG52
6 EMCG42
3 EMST41
2 EMST40
1 R 0 Always reads "0."
R 0 0 Active status of INT4 standby clear request 00 - 01: Rising edge 10: Falling edge 11: Both edges 11 10 EMST51 EMST50 R 0 0 Active status of INT5 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges 19 18 EMST61 EMST60 R 0 0 Active status of INT6 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges 27 26 EMST71 EMST70 R 0 0 Active status of INT7 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges
0 INT4EN R/W 0 INT4 Clear input 0: Disable 1: Enable
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
9 R 0 Always reads "0."
8 INT5EN R/W 0 INT5 Clear input 0: Disable 1: Enable
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
17 R 0 Always reads "0."
16 INT6EN R/W 0 INT6 Clear input 0: Disable 1: Enable
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
25 R 0 Always reads "0."
24 INT7EN R/W 0 INT7 Clear input 0: Disable 1: Enable
TMP19A43 (rev2.0) 6-47
Exceptions/Interrupts
TMP19A43
7 IMCGC (0xFFFF_EE18) bit Symbol Read/Write After reset Function R 0 Always reads "0."
5 4 EMCG81 EMCG80 R/W 0 1 0 Set active state of INT8 standby clear request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge 100: Both edges 13 12 EMCG91 EMCG90 R/W 0 1 0 Set active state of INT9 standby clear request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge 100: Both edges 21 20 EMCGA1 EMCGA0 R/W 0 1 0 Set active state of INTA standby clear request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge 100: Both edges 29 28 EMCGB1 EMCGB0 R/W 0 1 0 Set active state of INTB standby clear request. 00: "L" level 01: "H" level 10: Falling edge 11: Rising edge 100: Both edges 30 EMCGB2 22 EMCGA2 14 EMCG92
6 EMCG82
3 EMST81
2 EMST80
1 R 0 Always reads "0."
R 0 0 Active status of INT8 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges 11 10 EMST91 EMST90 R 0 0 Active status of INT9 standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges 19 18 EMSTA1 EMSTA0 R 0 0 Active status of INTA standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges 27 26 EMSTB1 EMSTB0 R 0 0 Active status of INTB standby clear request 00: - 01: Rising edge 10: Falling edge 11: Both edges
0 INT8EN R/W 0 INT8 Clear input 0: Disable 1: Enable
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
9 R 0 Always reads "0."
8 INT9EN R/W 0 INT9 Clear input 0: Disable 1: Enable
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
17 R 0 Always reads "0."
16 INTAEN R/W 0 INT9 Clear input 0: Disable 1: Enable
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
25 R 0 Always reads "0."
24 INTBEN R/W 0 INTB Clear input 0: Disable 1: Enable
TMP19A43 (rev2.0) 6-48
Exceptions/Interrupts
TMP19A43
7 IMCGD (0xFFFF_EE1C) bit Symbol Read/Write After reset Function R 0 Always reads "0."
6 R/W 0 Be sure to write "0."
5 4 EMCGC1 EMCGC0 R/W 1 0 Set active state of KWUP standby clear request. 01: "H" level Be sure to set "01." 13 12 EMCGD1 EMCGD0 R/W 1 0 Set active state of INTRTC standby clear request. 10: Falling edge Be sure to set "10."
3
2 R
1
The lead value is irregular.
0 KWUPEN R/W 0 KWUP Clear input 0: Disable 1: Enable 8 INTRTCE N R/W 0 INTRTC Clear input 0: Disable 1: Enable 16 INTTB2E N R/W 0 INTTB2 Clear input 0: Disable 1: Enable 24 INTTB3E N R/W 0 INTTB3 Clear input 0: Disable 1: Enable
Always reads "0."
15 bit Symbol Read/Write After reset Function R 0 Always reads "0."
14
11
10
9
R/W 0 Be sure to write "0."
R The lead value is irregular. Always reads "0."
23 bit Symbol Read/Write After reset Function R 0 Always reads "0."
22
21 EMCGE1
20 EMCGE0
19
18
17
R/W 0 Be sure to write "0."
R/W 1 0 Set active state of INTTB2 standby clear request. 11: Rising edge Be sure to set "11." The lead value is irregular.
R Always reads "0."
31 bit Symbol Read/Write After reset Function R 0 Always reads "0."
30
29 EMCGF1
28 EMCGF0
27
26
25
R/W 0 Be sure to write "0."
R/W 1 0 Set active state of INTTB3 standby clear request. 11: Rising edge Be sure to set "11." The lead value is irregular.
R Always reads "0."
Note:
Default values of EMCGx0 and EMCGx1 are different from the values to be used. Properly set them to the specified values before use.
TMP19A43 (rev2.0) 6-49
Exceptions/Interrupts
TMP19A43
Be sure to set active state of the clear request if interrupt is enabled for clearing the Stop, Sleep, or Idle standby mode. (Note1) When using interrupts, be sure to follow the following sequence of action: If shared with other general ports, enable the target interrupt input. Set active state, etc., upon initialization. Clear interrupt requests. Enable interrupts (Note 2) Settings must be performed while interrupts are disabled. (Note 3) For clearing the Stop and Sleep modes with TMP19A43, 16 factors, i.e., INT0 to INTB, INTRTC, INTTB2/INTTB3, and KWUP00 to 31 are available as clearing interrupts. Whether or not INT0 to INTB are to be used as clearing interrupts as well as active state edge/level selection is set with CG. Whether or not KWUP00 to 31 are to be used as STOP/SLEEP/IDLE clearing interrupts is set with CG and active state edge/level selection is set with KWUPSTn . Set to High level with INTC for the above 16 factors. (Note 4) Among the above 16 factors to be assigned as Stop/Sleep/Idle clear request interrupts, INT0 to INTB don't have to be set with CG if they are to be used as normal interrupts. Use INTC to specify either H/L level, rising/falling edge, or both edges. If KWUP00 to 31 are to be used as normal interrupts, set the active level by KWUPSTn and set High level with INTC. No CG setting is necessary. Also, if INTRTC is to be used as a normal interrupt, use CG/INTC for the setting. Interrupt factors other than those assigned as Stop/Sleep/Idle clear requests are set in the INTC block.
TMP19A43 (rev2.0) 6-50
Exceptions/Interrupts
TMP19A43
7 EICRCG (0xFFFF_EE20) bit Symbol Read/Write After reset Function
6 R 0
5
4
Always reads "0."
15 bit Symbol Read/Write After reset Function 23 bit Symbol Read/Write After reset Function 31 bit Symbol Read/Write After reset Function
14
13
12
2 1 0 ICRCG2 ICRCG1 ICRCG0 R/W 0 Always reads "0." Clear interrupt requests. 0000: INT0 0101: INT5 1010: INTA 0001: INT1 0110: INT6 1011: INTB 0010: INT2 0111: INT7 1100: KWUP 0011: INT3 1000: INT8 1101: INTRC 0100: INT4 1001: INT9 1110: INTTB2 1111:INTTB3 11 10 9 8
3 ICRCG3
22
21
R 0 Always reads "0." 20 19
18
17
16
30
29
Always reads "0." 28 27 R 0 Always reads "0."
26
25
24
(Note)
To clear interrupt request of the above 16 factors that are assigned to clear Stop/Sleep/Idle modes, For KWUP, use KWUPCLR For INT0 to INTB, ,INTRTC,INTTB2,INTTB3 use the EIRCG register in the above CG block.
TMP19A43 (rev2.0) 6-51
Exceptions/Interrupts
TMP19A43
6.10 NMI Flag Register
NMIFLG (0xFFFF_EE24) 7 bit Symbol Read/Write After reset Function 6 5 4 R 0 0 0 0 Always reads "0."
0 0 0 NMI factor 1: NMI generated by WDT interrupt 0 NMI factor 1: NMI generated by write bus error
3
2
1
WDT
0
WBER
15 bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function
14
13
12
11
10
9
8
0 23
0 22
0 21
R 0 0 Always reads "0." 20 19 R 0 0 Always reads "0." 28 27 R 0 0 Always reads "0."
0 18
0 17
0 16
0 31
0 30
0 29
0 26
0 25
0 24
0
0
0
0
0
0
* WDT and WBER are cleared to "0" when they are read.
Although TMP19A43 doesn't have NMI interrupts as external pin inputs, NMI interrupts are available as internal interrupt factors.
TMP19A43 (rev2.0) 6-52
Exceptions/Interrupts
TMP19A43
6.11 Cautions in Using Interrupts
The following paragraphs describe some points to be kept in mind in using interrupts. User programs must be written in a manner to satisfy the following details.
6.11.1
Cautions Related to TX19A Processor Core
* Exceptions cannot be disabled. Note that there are some cases where two different instructions can be distinguished only by exception generation. So, properly use them according to the specific usage. Software interrupts are different from the "software set" to be used as one of hardware interrupt factors. Immediately after overwriting SSCR of the CP0 register, add two NOP instructions to allow for register bank switching as it takes two clock cycles. In case multiple interrupts of the same interrupt level are accepted by changing ILEV , it is necessary for the user program to save because the register bank will not be switched. Only 32-bit ISA access can be used to access IER of the CP0 register. Different stack pointers (r29) are used for Shadow Register Set number 0 and Shadow Register Set numbers 1 to 7; it is necessary to set them separately (twice). If it is desired to use a common stack pointer, you can do so by setting SSCR to "1" in the main process to use Shadow Register Set number 1. In this case, when a level 1 interrupt is accepted, it is necessary for the user program to save because the register bank will not be switched. If an ERET instruction is executed while interrupts are disabled by setting Status of the CP0 register to "1," it returns to the main process by using ErrorEPC of the CP0 register as the return address. As the TX19A processor core saves the interrupt return address to EPC, you should be careful if Status is to be used for disabling interrupts. Don't execute an ERET instruction within two clock cycles after accessing Status, ErrorEPC, EPC, or SSCR of the CP0 register. If Status of the CP0 register is set to disable interrupts, interrupts are disabled at the time of instruction execution (E stage) but any value set to the register is reflected only two clocks later. If Status of the CP0 register is set to enable interrupts, interrupts are enabled two clocks after the instruction execution (E stage); any value set to the register is also reflected two clocks after the instruction execution (E stage).
* * * * *
*
* *
*
TMP19A43 (rev2.0) 6-53
Exceptions/Interrupts
TMP19A43
6.11.2
Cautions Related to INTC
* * * * * * * * * If more than one interrupts of a same interrupt level are generated at the same time, interrupts are accepted from the factor of the smallest interrupt number. Any factor of interrupt level 0 is not suspended. If it is desired to individually disable interrupt factors (by setting interrupt level 0), you can do so only while interrupts are disabled. Default settings of IMCx of INTC may be different from the settings to be used. The INTC ILEV register must be 32-bit accessed. The INTC INTCLR register must be 32-bit accessed. When an interrupt request is cleared by INTCLR before reading INTC IVR, the interrupt factor cannot be determined because the IVR value is cleared. When enabling interrupts, be sure to do so in the order of the detection route (from external to internal). When disabling, use the reverse order of the detection route (from internal to external). When a new value is written to INTC ILEV , set to "1" at the same time.
TMP19A43 (rev2.0) 6-54
Exceptions/Interrupts
TMP19A43
7.
Input/Output Ports
7.1 Port 0 (P00 through P07)
The port 0 is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register P0CR. A reset allows all bits of P0CR to be cleared to "0" and the port 0 to be put in input mode. Besides the general-purpose input/output function, the port 0 performs other functions: D0 through D7 function as a data bus and AD0 through AD7 function as an address data bus. When external memory is accessed, the port 0 automatically functions as either a data bus or an address data bus, and all bits of P0CR are cleared to "0." If the BUSMD pin (port P45) is set to "L" level during a reset, the port 0 is put in separate bus mode (D0 to D7). If it is set to "H" level during a reset, the port 0 is put in multiplexed mode (AD0 to AD7).
address/data output STOP/RESET DRIVE disable External bus opening
External access
Pull-up control (in units of bits) P0PE 1 P0CR 0 Direction control (in units of bits)
RESET
Internal data bus
D0toD7/ AD0toAD7 1
P0
(Output
latch)
0
PORT0 P00toP07 (D0toD7) (AD0toAD7 )
1
0
P0READ
D0toD7
P0Read
Fig. 7-1 Port 0 (P00 through P07)
Externa read
TMP19A43 (rev2.0) 7-1
Input/Output Ports
TMP19A43
7
P0 (0xFFFF_F000) Bit Symbol Read/Write After reset P07
6
P06
Port 0 register 5 4
P05 P04 R/W
3
P03
2
P02
1
P01
0
P00
Input mode (output latch register is cleared to "0.")
7
P0CR (0xFFFF_F002) Bit Symbol Read/Write After reset Function 0 P07C
6
Port 0 control register 5 4
P05C 0 P04C R/W 0
3
P03C 0
2
P02C 0
1
P01C 0
0
P00C 0
P06C 0
0: Input 1: Output (When an external area is accessed, D7-0 or AD7-0 is used and this register is cleared to "0.")
7
P0PE (0xFFFF_F00C) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PE07
Port 0 Pull-up control register 6 5 4
PE06 0 Pull-up 0: Off 1: Pull-Up PE05 0 Pull-up 0: Off 1: Pull-Up PE04 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PE03 0
2
PE02 0 Pull-up 0: Off 1: Pull-Up
1
PE01 0 Pull-up 0: Off 1: Pull-Up
0
PE00 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-2
Input/Output Ports
TMP19A43
7.2 Port 1 (P10 through P17)
The port 1 is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register P1CR and the function register P1FC. A reset allows all bits of the output latch P1, P1CR and P1FC to be cleared to "0" and the port 1 to be put in input mode. Besides the general-purpose input/output function, the port 1 performs other functions: D8 through D15 function as a data bus, AD8 through AD15 function as an address data bus, and A8 through A15 function as an address bus. To access external memory, registers P1CR and P1FC must be provisioned to allow the port 1 to function as either an address bus or an address data bus. If the BUSMD pin (port 45) is set to "L" level during a reset, the port 1 is put in separate bus mode (D8 to D15). If it is set to "H" level during a reset, the port 1 is put in multiplexed mode (AD8 to AD15 or A8 to A15).
address/data Output STOP/RESET DRIVE disable External bus opening
P1PEPull-up control (in units of bits) P1CRDirection control (in units of bits)
1 1 0 0
RESET
P1FCFunction control (in units of bits)
Internal data bus
A8toA15 TB AD8toAD15
1 0 0 Port1 P10toP17 (D8toD15) (AD8toAD15/A8toA15)
P1 (Output latch)
1
0
P1read
AD8toAD15
Fig. 7-2 Port 1 (P10 through P17)
P1 Access
External read
TMP19A43 (rev2.0) 7-3
Input/Output Ports
TMP19A43
Fig. 7-3 Port 1 (P10 through P17) Port 1 register 7
P1 (0xFFFF_F001) Bit Symbol Read/Write After reset P17
6
P16
5
P15
4
P14 R/W
3
P13
2
P12
1
P11
0
P10
Input mode (output latch register is cleared to "0.")
7
P1CR (0xFFFF_F004) Bit Symbol Read/Write After reset Function 0 P17C
Port 1 control register 6 5 4
P16C 0 P15C 0 P14C R/W 0
3
P13C 0
2
P12C 0
1
P11C 0
0
P10C 0
<< See P1FC >>
7
P1FC (0xFFFF_F005) Bit Symbol Read/Write After reset Function 0 P17F
Port 1 function register 6 5 4
P16F 0 P15F 0 P14F 0 R/W
3
P13F 0
2
P12F 0
1
P11F 0
0
P10F 0
P1FC/P1CR = 00: Input, 01: Output, 10: D15 through 8 or AD15 through 8, 11: A15 through 8
7
P1PE (0xFFFF_F00D) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PE17
Port 1 Pull-up control register 6 5 4
PE16 0 Pull-up 0: Off 1: Pull-Up PE15 0 Pull-up 0: Off 1: Pull-Up PE14 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PE13 0
2
PE12 0 Pull-up 0: Off 1: Pull-Up
1
PE11 0 Pull-up 0: Off 1: Pull-Up
0
PE10 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
Function POR1 input setting POR1 output setting Data bus (D15 through D8) input/output setting Separate bus mode (BUSMD="0") Address bus (A15 through A8) output setting Address data bus (AD15 through AD8) input/output setting Multiplexed bus mode (BUSMD="1") Address bus (A15 through A8) output setting
Corresponding BIT of P1FC 0 0 1 1 1 1
Corresponding BIT of P1CR 0 1 0
PORT to be used PORT1 PORT1 PORT1
1 0 PORT1 1
Table 7-1
TMP19A43 (rev2.0) 7-4
Input/Output Ports
TMP19A43
7.3 Port 2 (P20 through P27)
The port 2 is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register P2CR and the function register P2FC. A reset allows all bits of the output latch P2 to be set to "1," all bits of P2CR and P2FC to be cleared to "0," and the port 2 to be put in input mode. The port 2 also performs a 16-bit timer input function. This function is enabled by setting the corresponding bits of P2FC and P2FC2 to "1" and the corresponding bit of P2CR to "0." A reset allows P2CR and P2FC to be cleared to "0" and the port 2 to function as an input port. Besides the general-purpose input/output port function, the port 2 performs another function: A0 through A7 function as one address bus and A16 through A23 function as the other address bus. To access external memory, registers P2CR and P2FC must be provisioned to allow the port 2 to function as an address bus. If the BUSMD pin (port P45) is set to "L" level during a reset, the port 2 is put in separate mode (A16 to A23). If it is set to "H" level during a reset, the port 2 is put in multiplexed mode (A0 through A7 or A16 through A23).
TMP19A43 (rev2.0) 7-5
Input/Output Ports
TMP19A43
STOP/RESET Drive disable
External bus opening
P2PE
(Pull-up control)
1
P2CR 0
(Direction
control)
P2FC
(Function
control)
RESET
P2FC2
(Function
TB0IN0,TB0IN1 TB1IN0,TB1IN1 TB4IN0,TB4IN1 TB5IN0,TB5IN1
Internal data bus
control)
A16toA23 A0toA7
1 1 0 0
P2
(Output
latch)
Port2 P20toP27 (A16toA23) (A0toA7) (TB0IN0,TB0IN1) (TB1IN0,TB1IN1) (TB4IN0,TB4IN1) (TB5IN0,TB5IN1)
1
0
P2Read
Fig. 7-3 Port 2 (P20 through P27)
TMP19A43 (rev2.0) 7-6
Input/Output Ports
TMP19A43
Port 2 register 7
P2 (0xFFFF_F012) Bit Symbol Read/Write After reset P27
6
P26
5
P25
4
P24 R/W
3
P23
2
P22
1
P21
0
P20
Input mode (output latch register is set to "1.")
7
P2CR (0xFFFF_F014) Bit Symbol Read/Write After reset Function 0 P27C
Port 2 control register 6 5 4
P26C 0 P25C 0 P24C R/W 0
3
P23C 0
2
P22C 0
1
P21C 0
0
P20C 0
<>
7
P2FC (0xFFFF_F015) Bit Symbol Read/Write After reset Function 0 0 : Port 1: Function P27F
Port 2 function register 1 6 5 4
P26F 0 0 : Port 1: Function P25F 0 0 : Port 1: Function P24F R/W 0 0 : Port 1: Function
3
P23F 0 0 : Port 1: Function
2
P22F 0 0 : Port 1: Function
1
P21F 0 0 : Port 1: Function
0
P20F 0 0 : Port 1: Function
7
P2FC2 (0xFFFF_F016) Bit Symbol Read/Write After reset Function 0 P27F2
Port 2 function register 2 6 5 4
P26F2 0 P25F2 0 P24F2 R/W 0
3
P23F2 0
2
P22F2 0
1
P21F2 0
0
P20F2 0
0: Address 0: Address 0: Address 0: Address 0: Address 0: Address 0: Address 0: Address 1: TB5IN1 1: TB5IN0 1: TB4IN1 1: TB4IN0 1: TB1IN1 1: TB1IN0 1: TB0IN1 1: TB0IN0
7
P2PE (0xFFFF_F01C) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PE27
Port 2 pull-up control register 6 5 4
PE26 0 Pull-up 0: Off 1: Pull-Up PE25 0 Pull-up 0: Off 1: Pull-Up PE24 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PE23 0
2
PE22 0 Pull-up 0: Off 1: Pull-Up
1
PE21 0 Pull-up 0: Off 1: Pull-Up
0
PE20 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
Function POR2 input setting POR2 output setting Address bus (A7 through A0) output setting (*1) Address bus (A23 through A16) output setting (*1) TMRB input setting
Corresponding BIT of P2FC 0 0 1 1 1
Corresponding BIT of P2FC2 * * 0 0 1
Corresponding BIT of P2CR 0 1 0 1 0
PORT to be used PORT2 PORT2 PORT2 PORT2 PORT2
Table 7-2
(*1) The same address bus (A7 through A0/A23 through A16) output settings are used in both the separate bus mode and the multiplexed bus mode (BUSMD="0," "1").
TMP19A43 (rev2.0) 7-7
Input/Output Ports
TMP19A43
7.4 Port 3 (P30 through P37)
The port 3 is a general-purpose, 8-bit input/output port (P30 and P31 are used exclusively for output). For this port, inputs and outputs can be specified in units of bits by using the control register P3CR and the function register P3FC. A reset allows the output latches P30 and 31 to be set to "1." Besides the input/output port function, the port 3 performs other functions: P34 outputs a 16-bit timer, and P35, P36 and P37 perform the 32-bit capture and trigger input function. These functions are enabled by setting the corresponding bit of P3FC to "1." A reset allows P3CR and P3FC to be cleared to "0" and the port 3 to function as an input port. In addition to above functions, a function of inputting and outputting the control and status signals of CPU is provided. If the P30 pin is set to RD signal output mode (="1"), the RD strobe is output only when an external address area is accessed. Likewise, if the P31 pin is set to WR signal output mode (="1"), the
WR strobe is output only when an external address area is accessed.
STOP DRIVE Disable
External bus opening
P3PE
(Pull-up Control)
1
0
RESET
Internal data bus
P3FC
(Function control)
P3 (Output latch)
RD , WR
1
P30 ( RD ) P31 ( WR )
0
P0Read
Fig. 7-4 Port 3 (P30, P31)
TMP19A43 (rev2.0) 7-8
Input/Output Ports
TMP19A43
STOP/RESET DRIVE Disable
P3PE
(Pull-up countrol)
P3CR
(Direction
control)
RESET
P3FC
(Function
Internal data bus
control)
(Output
P3 latch)
P33 ( WAIT/RDY )
1
0
P3read
1
WAIT/RDY
0
Fig. 7-5 Port 3 (P33)
TMP19A43 (rev2.0) 7-9
Input/Output Ports
TMP19A43
STOP/READ Drive Disable
P3PE
(Pull-upControl)
P3CR
(Direction
control)
RESET
P3FC
(Function
Internal data bus
control)
TBEOUT 1
P3
(Output
latch)
0
P34 ( BUSRQ) (TBEOUT)
1
0
P3Read
BUSRQ
Fig. 7-6 Port 3 (P34)
TMP19A43 (rev2.0) 7-10
Input/Output Ports
TMP19A43
STOP/Reset DRIVE Disable External bus opening
P3PE
(Pull-up Control)
1 P3CR
(Direction
control)
0
RESET
P3FC
(Function
Internal data bus
control)
BUSAK 1
P3
(Output
P35 ( BUSAK ,TC1IN) 0
latch)
1
0
P3Read
TC1IN RESET
Fig. 7-7 Port 3 (P35)
TMP19A43 (rev2.0) 7-11
Input/Output Ports
TMP19A43
STOP drive Disable
P3PE
(Pull-up Control)
0 P3CR Direction control 1 RESET
P3FC
(Function
Internal data bus
control)
ALE
P3
(Output
1 P37 (ALE) (TC3IN)
latch)
0
1
0
PRead
TC3IN
Fig. 7-8 Port 3 (P37)
TMP19A43 (rev2.0) 7-12
Input/Output Ports
TMP19A43
Port 3 register
7
P3 (0xFFFF_F018) Bit Symbol Read/Write After reset To be determined according to the bus mode P37
6
P36
5
P35
4
P34 R/W Input mode
3
P33
2
P32
1
P31
0
P30
Output mode
1
1
7
P3CR (0xFFFF_F01A) Bit Symbol Read/Write After reset Function According to the bus mode P37C
Port 3 control register 6 5 4
P36C 0 P35C 0 P34C R/W 0
3
P33C 0 0: Input 1: Output
2
P32C 0
1
-
0
0
-
0
7
P3FC (0xFFFF_F01B) Bit Symbol Read/Write After reset Function 0 0: PORT 1: ALE/ TC3IN P37F
Port 3 function register 1 6 5 4
P36F 0 0: PORT 1: R / W P35F 0 0: PORT
1: BUSAK
3
P33F
2
P32F 0 0: PORT
1
P31F 0 0: PORT
0
P30F 0 0: PORT
P34F R/W 0 0: PORT
1: BUSRQ
0 0: PORT/ WAIT 1: PORT/ RDY
1: HWR / TC0IN
1: WR
1: RD
7
P3PE (0xFFFF_F01D) Bit Symbol Read/Write After reset Function 0
Pull-up
Port 3 pull-up control register 6 5 4
PE36 0
Pull-up
3
PE33
2
PE32 0
Pull-up
1
PE31 0
Pull-up
0
PE30 0
Pull-up
PE37
PE35 0
Pull-up
PE34 R/W 0
Pull-up
0
Pull-up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-13
Input/Output Ports
TMP19A43
PORT to be used
Function
Corresponding BIT of P3FC
Corresponding BIT of P3CR
BUSMD H H
P30/P31
P30/31output setting RD/WRoutput setting P32/P36input setting P32/P36output setting TC0IN/TC2INinput setting HWR/ R/WOutput setting P33input setting P33output setting WAITinput setting RDYinput setting P34input setting P34output setting BUSRQinput setting TBEOUTOutput setting P35input setting P35output setting TC1IN input setting BUSAK output setting P37input setting P37output setting TC3IN input setting ALE output setting Table 7-3
0 1 *

P32/P36
P33
0 1 1 * * 0 1 * 0 1 1 * 0 1 1
*
P34
P35
P37
0 1 1
0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 1 0 1 0 1
(*1)
(*2)
In separate bus mode (BUSMD="0"), ALE is not output. The port 3 functions as an input/output port based on the bit setting of the control register P3CR. After a reset, the port becomes an input port. If a reset is executed in multiplexed bus mode (BUSMD="1"), the port 3 becomes an output port at "L" level. /RD and /WR are output only when an external area is being accessed.
TMP19A43 (rev2.0) 7-14
Input/Output Ports
TMP19A43
7.5 Port 4 (P40 through P47)
The port 4 is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register P4CR and the function register P4FC. Besides the general-purpose input/output port function, the port 4 performs other functions: P40 through P43 output the chip select signal ( CS0 to CS3 ) and input the key-on wake-up, P44 functions as the SCOUT output pin for outputting internal clocks, and P47 outputs a 16-bit timer. By making necessary settings during a reset, P45 functions as a BUSMD pin for setting external bus modes, and P46 as an ENDIAN setting pin.
KEY ch24, STOP/RESET Drive Disable External bus opening system reset ch25,ch27 pull-up
P4PE
(Pull-up control)
1 P4CR
(Direction
control)
0
RESET
P4FC
(Function
Internal data bus
control)
CS0 , CS1,
CS3
1
P40 ( CS0 )KEY24 P41 ( CS1)KEY25
P4 (Output latch)
0
P43 ( CS3 )KEY27
1
0
P4Read
KEY24 KEY25 KEY27
Fig. 7-9 Port 4 (P40 to P43) If the port 4 goes into STOP mode when the KEY input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * Port: Inputs are accepted only during a read. * KEY: Inputs are always accepted.
TMP19A43 (rev2.0) 7-15
Input/Output Ports
TMP19A43
STOP/RESET Drive disable External bus opening
system reset
KEY ch26 pull-up
P4PE
(Pull-up control)
1 P4CR
(Direction
0
RESET
control) Internal data bus
KEY26
P4FC
(Function
control)
CS2
1
P42 ( CS2 )KEY26
P4 (Output latch)
0
1
0
P4read
Fig. 7-10Port 4 (P42)
TMP19A43 (rev2.0) 7-16
Input/Output Ports
TMP19A43
STOP/RESET drive disable
P4PE
(Pull-up control)
P4CR (Direction control)
RESET
P4FC
(Function
Internal data bus
control)
SCOUT
1
P44 (SCOUT)
P4
(Output
latch)
0
1
0
P4read
Fig. 7-11Port 4 (P44)
TMP19A43 (rev2.0) 7-17
Input/Output Ports
TMP19A43
STOP/RESET drive disable
system reset
P4PE
(Pull-up control)
P4CR
(direction control)
RESET
Internal data bus P4
(output latch) port4 P45,46 (BUSMD,ENDIAN)
1
0
P4 read
BUSMD,ENDIAN
Fig. 7-12 Port 4 (P45,46)
TMP19A43 (rev2.0) 7-18
Input/Output Ports
TMP19A43
STOP/RESET drive disable
system reset
P4PE
(Pull-up control)
P4CR
(Direction
control)
RESET
P4FC
(Function
Internal data bus
control)
TBFOUT
1
P47 (TBEOUT
P4 (Output latch)
0
1
0
P4read
Fig. 7-13 Port 4 (P47)
TMP19A43 (rev2.0) 7-19
Input/Output Ports
TMP19A43
7
P4 (0xFFFF_F01E) Bit Symbol Read/Write After reset P47
6
P46
Port 4 register 5 4
P45 P44 R/W
3
P43
2
P42
1
P41
0
P40
Input mode (output latch register is set to "1.")
7
P4CR (0xFFFF_F020) Bit Symbol Read/Write After reset 0 P47C
Port 4 control register 6 5 4
P46C 0 P45C 0 P44C R/W 0
3
P43C 0 0: Input
2
P42C 0
1
P41C 0 1: Output
0
P40C 0
7
P4FC (0xFFFF_F021) Bit Symbol Read/Write After reset Function 0 0: PORT 1: TBFOUT P47F
Port 4 function register 6 5 4
P46F 0 Write 0 P45F 0 Write 0 P44F R/W 0 0: PORT
3
P43F 0 0: PORT /KEY27
/KEY27
2
P42F 0 0: PORT/ KEY26
1: CS2 /KEY26
1
P41F 0 0: PORT/ KEY25
1: CS1 /KEY25
0
P40F 0 0: PORT/ KEY24
1: CS0 /KEY24
1: SCOUT 1: CS3
7
P4PE (0xFFFF_F025) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PE47
Port 4 pull-up control register 6 5 4
PE46 0 Pull-up 0: Off 1: Pull-Up PE45 0 Pull-up 0: Off 1: Pull-Up PE44 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PE43 0
2
PE42 0 Pull-up 0: Off 1: Pull-Up
1
PE41 0 Pull-up 0: Off 1: Pull-Up
0
PE40 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-20
Input/Output Ports
TMP19A43
PORT to be used
Function
Corresponding BIT of P4FC
Corresponding BIT of P4CR
P40/P41/P43
P40/P41/P43input setting P40/P41/P43output setting KEY24/25/27input setting CS0/CS1/CS3Output setting P42input setting P42output setting KEY26input setting CS2Output setting P44input setting P44output setting SCOUT setting P45/P46input setting P45/P46output setting BUSMD/ENDIANinput setting P47input setting P47output setting TBEOUTOutput setting Table 7-4
0
0 * 1 0 0 * 1 * 0 1
-
P42
P44
P45/P46
*
0 1 0 1 0 1 0 1 0 1 1 0 1 * 0 1 1
P47
0 1
TMP19A43 (rev2.0) 7-21
Input/Output Ports
TMP19A43
7.6 Port 5 (P50 through P57)
The port 5 is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register P5CR and the function register P5FC. A reset allows all bits of the output latch P5 to be set to "1," all bits of P5CR and P5FC to be cleared to "0," and the port 5 to be put in input mode. Besides the input/output port function, the port 5 performs other functions: P50 through P53 input external interrupts, P54 through P57 output a 16-bit timer, and P56 and P57 input the key-on wake-up. These functions are enabled by setting the corresponding bit of P5FC to "1." A reset allows P5CR and P5FC to be cleared to "0" and the port 5 to function as an input port. The port 5 also functions as an address bus (A0 through A7). To access external memory, P5CR and P5FC must be provisioned to allow the port 5 to function as an address bus. This address bus function can be used only in separate bus mode. (To put the port 5 in separate bus mode, the BUSMD pin (port 45) must be set to "L" level during a reset.)
TMP19A43 (rev2.0) 7-22
Input/Output Ports
TMP19A43
STOP/RESET drive disable External bus opening
P5PE
(Pull-up)
1 P5CR
(Direction control)
0
RESET
INTCtoINTF
NF (40ns typ)
Internal data bus
P5FC
(Function control)
A0to3 P5
(Output latch)
1
port5 P50toP53 (A0toA3) (INTCtoINTF)
0
1
0
P5 read
Fig. 7-14 Port 5 (P50 to P53)
If the port 5 goes into STOP mode when the INT input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * Port: Inputs are accepted only during a read. * INT: Inputs are always accepted.
TMP19A43 (rev2.0) 7-23
Input/Output Ports
TMP19A43
STOP/RESET drive disable
External bus opening
P5PE
(Pull-up)
1 P5CR
(Direction control)
0
Internal data bus
P5FC
(Function control)
RESET
P5FC2
(Function control) TB0OUT,
A4to5 1 1 0
TB1OUT
port5 P54toP55 (A4toA5) ( TB0OUT,TB1OUT)
P5
(Output
latch
0
1
0
P5 read
Fig. 7-15 Port 5 (P54 and P55)
TMP19A43 (rev2.0) 7-24
Input/Output Ports
TMP19A43
STOP/RESET drive disable
KEY ch28,ch29 External bus opening pull-up
P5PE
(Pull-up control)
1 P5CR
(Direction control)
0
If the port 5 goes into STOP mode when the KEY input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * Port: Inputs are accepted only during a read. * KEY: Inputs are always accepted.
Internal data bus
KEY29
P5FC
(Function control)
RESET
P5FC2
(Function control) TB2OUT,
A6,7 1 1 0 0
TB3OUT
port5 P56toP57(A6toA7, TB2OUT,TB3OUT KEY28,29)
P5
(Output latch)
1
0
P5 read KEY28, NF (40ns typ)
Fig. 7-16 Port 5 (P56 to P57)
TMP19A43 (rev2.0) 7-25
Input/Output Ports
TMP19A43
7
P5 (0xFFFF_F028) Bit Symbol Read/Write After reset P57
6
P56
Port 5 register 5 4
P55 P54 R/W
3
P53
2
P52
1
P51
0
P50
Input mode (output latch register is set to "1.")
7
P5CR (0xFFFF_F02C) Bit Symbol Read/Write After reset Function 0 P57C
6
Port 5 control register 5 4
P55C 0 P54C R/W 0
3
P53C 0
2
P52C 0
1
P51C 0
0
P50C 0
P56C 0
<>
7
P5FC (0xFFFF_F02D) Bit Symbol Read/Write After reset Function 0 P57F
Port 5 function register 1 6 5 4
P56F 0 P55F 0 P54F R/W 0
3
P53F 0
2
P52F 0
1
P51F 0
0
P50F 0
P5FC/P5CR = 00: Input, 01: Output, 10: Input, 11: A7 through 0
7
P5FC2 (0xFFFF_F03C) Bit Symbol Read/Write After reset Function 0 0: Address/ PORT 1: TB3OUT P57F2
Port 5 function register 2 6 5 4
P56F2 R/W 0 0 0 0: Address/ 0: Address/ 0: Address/ PORT PORT PORT 1: TB2OUT 1: TB1OUT 1TB0OUT P55F2 P54F2
3
2
- R 0
1
0
"0" is read.
Note:
If P5FC = "0" and P5FC2 = "1," TB3OUT through TB0OUT are selected. To use the port 5 in the PORT setting, set both P5FC and P5FC2 to "0." 7 Port 5 pull-up control register 6 5 4
PE56 0 Pull-up 0: Off 1: Pull-Up PE55 0 Pull-up 0: Off 1: Pull-Up PE54 R/W 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up
3
PE53
2
PE52
1
PE51
0
PE50
P5PE (0xFFFF_F026)
Bit Symbol Read/Write After reset Function
PE57
TMP19A43 (rev2.0) 7-26
Input/Output Ports
TMP19A43
PORT to be used
Function
Corresponding BIT of P5FC2
Corresponding BIT of P5FC
Corresponding BIT of P5CR
P50 to P53
P50toP53input setting P50toP53output setting INTCtoINTFinput setting A0toA3output setting P54/P55input setting
-
*
*
0 1 1
*
0 1 0 1 0 1 1 1
0 1 1 1 0
P54/P55
P54/P55output setting TB0OUT/TB1OUToutput setting A4/A5output setting
0 1
0 * 0 1 0 * Table 7-5
0 *
1 0 0 * 1 0
P56/P57input setting P56/P57output setting TB2OUT/TB3OUToutput setting A4/A5output setting KEY28/KEY29input setting
P56/P57
TMP19A43 (rev2.0) 7-27
Input/Output Ports
TMP19A43
7.7 Port 6 (P60 through P67)
The port 6 is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register P6CR and the function register P6FC. A reset allows all bits of the output latch P6 to be set to "1," all bits of P6CR and P6FC to be cleared to "0," and the port 6 to be put in input mode. Besides the input/output port function, the port 6 performs other functions: P60 and P63 output SIO data, P61 and P64 input SIO data, P62 and P65 input and output SIO CLK or input CTS, P61 and P64 input external interrupts, and P66 and P67 output a 16-bit timer. The port 6 also functions as an address bus (A8 through A15). To access external memory, P6CR and P6FC must be provisioned to allow the port 6 to function as an address bus. The address bus function can be used only in separate bus mode. (To put the port 6 in separate bus mode, the BUSMD pin (port 45) must be set to "L" level during a reset.)
TMP19A43 (rev2.0) 7-28
Input/Output Ports
TMP19A43
STOP/RESET drive disable External bus opening
P6PE
(Pull-up control)
1 P6CR
(Direction control)
0
Internal data bus
P6FC
(Function control)
RESET
P6FC2
(Function control)
A8,11 1
TXD0,1
1 0 0
port6 P60, P63(A8,A11) TXD0,TXD1
P6
(Output latch)
P6ODE
(Open
drain )
1
0
P6read
Fig. 7-17 Port 6 (P60, P63)
TMP19A43 (rev2.0) 7-29
Input/Output Ports
TMP19A43
STOP/RESET drive disable External bus opening
P6PE
(Pull-up control)
1 P6CR
(Direction control)
0
Internal data bus
RXD0,RXD1 INTA,B
P6FC
(Function control)
RESET
P6FC2
(Function control)
A9,12 P6
(Output latch)
1
port6 P61, P64(A9,A12) RXD0RXD1
0
INTA,INTB
1
0
P6 read
NF (40ns typ)
Fig. 7-18 Port 6 (P61, P64)
TMP19A43 (rev2.0) 7-30
Input/Output Ports
TMP19A43
STOP/RESET drive disable
External bus opening
P6PE
(ull-up control)
1 P6CR
(Direction control)
0
CTS0, CTS1 SCLK0, SCLK1
Internal data bus
P6FC
(Function control)
RESET
P6FC2
(Function control)
A10,13 1
SCLK0,1
1 0 0
P62 (SCLK0/CTS0,A10) P65 (SCLK1/CTS1,A13)
P6
(Output latch)
P6ODE
(Open drain)
1
0
P6 read
Fig. 7-19 Port 6 (P62, P65)
TMP19A43 (rev2.0) 7-31
Input/Output Ports
TMP19A43
STOP/RESET drive disable
External bus opening
P6PE
(Pull-up control)
1 P6CR
(Direction control)
0
Internal data bus
P6FC
(Function control)
RESET
P6FC2
(Function control)
TB5OUT, TB4OUT 1 A14,A15
1
port6 P66toP67
P6
(Output latch)
0 0
(A14toA15, TB4OUT,TB5OUT)
1
0
P6 read
Fig. 7-20 Port 6 (P66, P67)
TMP19A43 (rev2.0) 7-32
Input/Output Ports
TMP19A43
Port 6 register
7
P6 (0xFFFF_F029) Bit Symbol Read/Write After reset P67
6
P66
5
P65
4
P64 R/W
3
P63
2
P62
1
P61
0
P60
Input mode (output latch register is set to "1.")
7
P6CR (0xFFFF_F02E) Bit Symbol Read/Write After reset Function 0 P67C
Port 6 control register 6 5 4
P66C 0 P65C 0 P64C W
3
P63C
2
P62C
1
P61C
0
P60C
0
0
0
0
0
<< See P6FC >>
7
P6FC (0xFFFF_F02F) Bit Symbol Read/Write After reset Function 0 P67F
Port 6 function register 6 5 4
P66F 0 P65F 0 P64F W 0
3
P63F 0
2
P62F 0
1
P61F 0
0
P60F 0
P6FC/P6CR = 00: Input, 01: Output, 10: Input, 11: A15 through 8 Port 6 function settings P6CR P60, P63 Separate bus mode (BUSMD="L") 0 1 Output port 0 Input port Address bus (A11, 8) /TXD0, 1 Input port Output port Address bus (A11, 8) /TXD0, 1 P6FC 0 Input mode (INTA, B) Output port Input port (INTA, B) Output port 1 RXD0, 1/INTA, B Address bus (A12-9) RXD0, 1/INTA, B Address bus (A12-9) P6FC 0 Input port Output port 1 SCLK0, 1/CTS0, 1 Address bus (A13-10) /SCLK0, 1 SCLK0, 1/CTS0, 1 Address bus (A13-10) /SCLK0, 1 P6FC 1
Multiplexed bus mode (BUSMD="H")
0 1
P6CR Separate bus mode (BUSMD="L") Multiplexed bus mode (BUSMD="H") 0 1 0 1 P6CR
P61, P64
P62, P65
Separate bus mode (BUSMD="L")
0 1
Multiplexed bus mode (BUSMD="H")
0 1
Input port Output port
TMP19A43 (rev2.0) 7-33
Input/Output Ports
TMP19A43
P6CR 0
P6FC 1 Input port Output port Address bus (A15, 14) /TB4OUT, TB5OUT Input port Output port Address bus (A15, 14) /TB4OUT, TB5OUT
P66, P67
Separate bus mode (BUSMD="L")
0 1
Multiplexed bus mode (BUSMD="H")
0 1
7
P6FC2 (0xFFFF_F03D) Bit Symbol Read/Write After reset Function 0
0: A15 1: TB5OUT
Port 6 function register 2 6 5 4
P66F2 0 0: A14 1: TB4OUT P65F2 0 0: A13 1: SCLK1/ CTS1 P64F2 R/W 0 0: A12 1:RXD1
3
P63F2 0 0: A11 1: TXD1
2
P62F2 0 0: A10 1: SCLK0/ CTS0
1
P61F2 0 0: A9 1: RXD0
0
P60F2 0 0: A8 1: TXD0,
P67F2
Note:
If P6FC = "0" and P6FC2 = "1," PORT is selected. To use this function register as a functional pin, set both P6FC and P6FC2 to "1." (Set 1, 4bit to P6FC2 = "0.") Port 6 pull-up control register 6 5 4
PE66 0 Pull-up 0: Off 1: Pull-Up PE65 0 Pull-up 0: Off 1: Pull-Up PE64 R/W 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up 0 Pull-up 0: Off 1: Pull-Up
7
P6PE (0xFFFF_F027) Bit Symbol Read/Write After reset Function PE67
3
PE63
2
PE62
1
PE61
0
PE60
7
P6ODE Bit Symbol After reset Function - (0xFFFF_ F030) Read/Write
Port 6 open drain control register 6 5 4 3
P65ODE R/W 0 0: CMOS 1: Open
drain
2
P62ODE 0 0: CMOS 1: Open
drain
1
- R 0 "0" is read.
0
P60ODE R/W 0 0: CMOS 1: Open
drain
- R 0 "0" is read.
P63ODE 0 0: CMOS 1: Open
drain
R 0 "0" is read.
R/W
TMP19A43 (rev2.0) 7-34
Input/Output Ports
TMP19A43
PORT to be used
Function
Corresponding BIT of P6FC2
Corresponding BIT of P6FC
Corresponding BIT of P6CR
P60/P63
P61/P64
P60/P63input setting P60/P63Output setting TXD0/TXD1Output setting A8/A11Output setting P61/P64input setting P61/P64Output setting RXD0/RXD1input setting INTA/INTBinput setting A9,A12Output setting P62/P65input setting P62/P65Output setting SCLK0/SCLK1Output setting CTS0/CTS1/SCLK0/SCLK1 input setting A10/A13Output setting P66/P67input setting P66/P67Output setting TB4OUT/TB5OUTOutput setting A15/A16Output setting Table 7-6
* * 1 0 * * 1 * 0 * * 1 1 0 * * 1 0
* 0 1 1 0 0 1 0 1 * 0 * 1 1 * 0 1 1
0 1 1 1 0 1 0 0 1 0 1 1 0 1 0 1 1 1
P62/P65
P66/P67
TMP19A43 (rev2.0) 7-35
Input/Output Ports
TMP19A43
7.8 Port 7 (P70 through P77)
The port 7 is an 8-bit, analog input port for the A/D converter. Although P74 through P77 form part of the analog input port, they also perform another function of inputting the key-on wake-up.
P7 accsess
* If the port 7 goes into STOP mode when the PORT input is enabled, inputs are always accepted. To inhibit inputs, switch to AD using the function register. * AD: Inputs are accepted only during a read. Inputs are inhibited in STOP mode. * PORT: Inputs are always accepted.
Internal data bus
P7PE
(Pull-up control)
P70toP73 (AIN0toAIN3) P7read
AIN0toAIN3
Fig. 7-21 Port 7 (P70 through P73)
TMP19A43 (rev2.0) 7-36
Input/Output Ports
TMP19A43
KEY ch00toch03 pull-up
* If the port 7 goes into STOP mode when the KEY/PORT input is enabled, inputs are always accepted. To inhibit inputs, switch to AD using the function register. * AD: Inputs are accepted only during a read. Inputs are inhibited in STOP mode. * KEY/PORT: Inputs are always accepted.
Internal data bus
P7PE
(Pull-up control)
1
0
P7FC
(Function control)
P74toP77 (AIN4toAIN7 KEY00toKEY03) P7read
KEY00toKEY03
NF (40ns typ)
AIN4toAIN7 Fig. 7-22 Port 7 (P74 through P77)
TMP19A43 (rev2.0) 7-37
Input/Output Ports
TMP19A43
7
P7 (0xFFFF_F040) Bit Symbol Read/Write After reset P77
6
P76
Port 7 register 5 4
P75 P74 R
3
P73
2
P72
1
P71
0
P70
Input mode
7
P7FC (0xFFFF_F048) Bit Symbol Read/Write After reset Function 0 0: A/D 1: PORT /KEY03 P77F
6
Port 7 function register 5 4
P75F R/W 0 0: A/D 1: PORT /KEY01 P74F 0 0: A/D 1: PORT /KEY00
3
-
2
- R 0
1
-
0
-
P76F 0 0: A/D 1: PORT /KEY02
"0" is read.
7
P7PE (0xFFFF_F04C) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PE77
Port 7 pull-up control register 6 5 4
PE76 0 Pull-up 0: Off 1: Pull-Up PE75 0 Pull-up 0: Off 1: Pull-Up PE74 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PE73 0
2
PE72 0 Pull-up 0: Off 1: Pull-Up
1
PE71 0 Pull-up 0: Off 1: Pull-Up
0
PE70 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-38
Input/Output Ports
TMP19A43
7.8 Port 8 (P80 through P87)
The port 8 is an 8-bit, analog input port for the A/D converter. Besides this analog input port function, P80 through P83 input the key-on wake-up, and P84 through P87 input external interrupts.
KEY ch04toch07 pull-up
If the port 8 goes into STOP mode when the KEY/PORT input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * AD: Inputs are accepted only during a read. Inputs are inhibited in STOP mode. * KEY/PORT: Inputs are always accepted.
Internal data bus
P8PE
(Pull-up control)
1 0
P8FC
(Function control)
P80toP83 (AIN8toAIN11 KEY04toKEY08) P8 Read
KEY04toKEY08
NF (40ns typ)
AIN8toAIN11 Fig. 7-23 Port 8 (P80 through P83)
TMP19A43 (rev2.0) 7-39
Input/Output Ports
TMP19A43
* If the port 8 goes into STOP mode when the KEY/PORT/INT input is enabled, inputs are always accepted. To inhibit inputs, switch to AD using the function register. * AD: Inputs are accepted only during a read. Inputs are inhibited in STOP mode. * KEY/PORT/INT: Inputs are always accepted.
Internal data bus
P8PE
(Pull-up control)
1
0
P8FC
(Function control)
P84toP87 (AIN12toAIN15 INT6toINT9) P8 read
INT6toINT9
NF (40ns typ)
AIN12toAIN15
Fig. 7-24 Port 8 (P84 through P87)
TMP19A43 (rev2.0) 7-40
Input/Output Ports
TMP19A43
7
P8 (0xFFFF_F041) Bit Symbol Read/Write After reset P87
6
P86
Port 8 register 5 4
P85 P84 R
3
P83
2
P82
1
P81
0
P80
Input mode
7
P8FC (0xFFFF_F049) Bit Symbol Read/Write After reset Function 0 0: A/D 1: PORT /INT9 P87F
6
Port 8 function register 5 4
P85F 0 0: A/D 1: PORT / INT7 P84F RW 0 0: A/D 1: PORT / INT6
3
P83F 0 0: A/D 1: PORT / KEY07
2
P82F 0 0: A/D 1: PORT / KEY06
1
P81F 0 0: A/D 1: PORT / KEY05
0
P80F 0 0: A/D 1: PORT / KEY04
P86F 0 0: A/D 1: PORT / INT8
7
P8PE (0xFFFF_F04D) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PE87
Port 8 pull-up control register 6 5 4
PE86 0 Pull-up 0: Off 1: Pull-Up PE85 0 Pull-up 0: Off 1: Pull-Up PE84 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PE83 0
2
PE82 0 Pull-up 0: Off 1: Pull-Up
1
PE81 0 Pull-up 0: Off 1: Pull-Up
0
PE80 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-41
Input/Output Ports
TMP19A43
7.9 Port 9 (P90 through P97)
The port 9 is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register P9CR and the function register P9FC. A reset allows all bits of the output latch P9 to be set to "1," all bits of P9CR and P9FC to be cleared to "0," and the port 9 to be put in input mode. Besides the input/output port function, the port 9 performs other functions: P93 outputs SI0 data, P94 inputs SI0 data, P95 inputs and outputs SI0 CLK or inputs CTS, and P90, P91, P92, P96 and P97 output a 16-bit timer.
STOP/RESET drive disable
P9PE
(Pull-up control)
P9CR
(Direction control)
RESET
P9FC
(Function control) TB6OUTtoTB AOUT
Internal data bus
1 P9
(Output latch)
0
port 9 P90toP92,P96,P97 (TB6OUTtoTBAOUT)
1
0
P9 Read
Fig. 7-25 Port 9 (P90, P91, P92, P96 and P97)
TMP19A43 (rev2.0) 7-42
Input/Output Ports
TMP19A43
STOP/RESET drive disable
P9PE
(Pull-up control)
P9CR
(Direction control)
Internal data bus
RESET
P9FC
(Function control) TXD2
1
P9
(Output latch)
0
P9ODE
(Open drain)
1
0
P9 read
Fig. 7-26 Port 9 (P93)
TMP19A43 (rev2.0) 7-43
Input/Output Ports
TMP19A43
STOP/RESET drive disable
P9PE
(Pull-up control)
P9CR
(Direction control)
Internal data bus
RESET
P9FC
(Function control)
P9
(Output latch)
port9 (P94 RXD2)
1
0
P9 read
RXD2
Fig. 7-27 Port 9 (P94)
TMP19A43 (rev2.0) 7-44
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PBPE
(Pull-up control)
PBCR
(Direction control)
Internal data bus
RESET
PBFC
(Function control) SCLK2
1
P95 (SCLK2/CTS2)
PB
(Output latch)
0
PBODE
(Open drain)
1
0
PB Read CTS2 SCLK2
Fig. 7-28 Port 9 (P95)
TMP19A43 (rev2.0) 7-45
Input/Output Ports
TMP19A43
Pull-up control (in units of bits) P9PE
Direction control (in units of bits) P9CR
Internal data bus
Function control (in units of bits) P9FC
STOP DRIVE
Output latch P9 0 1 Reset S
P95 (SCLK2/CTS2)
Selector
S Y P9 read Selector
1 0
CTS2 SCLK2
Fig. 7-29 Port 9 (P95)
TMP19A43 (rev2.0) 7-46
Input/Output Ports
TMP19A43
7
P9 (0xFFFF_F042) Bit Symbol Read/Write After reset P97
6
P96
Port 9 register 5 4
P95 P94 R/W
3
P93
2
P92
1
P91
0
P90
Input mode (output latch register is set to "1.")
7
P9CR (0xFFFF_F046) Bit Symbol Read/Write After reset Function 0 P97C
6
Port 9 control register 5 4
P95C 0 P94C R/W 0
3
P93C 0
2
P92C 0
1
P91C 0
0
P90C 0
P96C 0
0: Input 1: Output
7
P9FC (0xFFFF_F04A) Bit Symbol Read/Write After reset Function 0 0: PORT
1: TBAOUT
Port 9 function register 6 5 4
P96F 0 0: PORT 1: TB9OUT P95F 0 0: PORT 1: SCLK2/ CTS2 P94F R/W 0 0: PORT 1: RXD2
3
P93F 0 0: PORT 1: TXD2
2
P92F 0 0: PORT
1: TB8OUT
1
P91F 0 0: PORT 1: TB7OUT
0
P90F 0 0: PORT 1: TB6OUT
P97F
7
P9PE (0xFFFF_F04E) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PE97
Port 9 pull-up control register 6 5 4
PE96 0 Pull-up 0: Off 1: Pull-Up PE95 0 Pull-up 0: Off 1: Pull-Up PE94 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PE93 0
2
PE92 0 Pull-up 0: Off 1: Pull-Up
1
PE91 0 Pull-up 0: Off 1: Pull-Up
0
PE90 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
7
P9ODE (0xFFFF_F031) Bit Symbol Read/Write After reset Function -
Port 9 open drain control register 6 5 4 3
P95ODE R/W 0 0: CMOS 1: Open
drain
2
1
- R 0 "0" is read.
0
- R 0 "0" is read.
P93ODE R/W 0 0: CMOS 1: Open
drain
R 0 "0" Is read.
TMP19A43 (rev2.0) 7-47
Input/Output Ports
TMP19A43
7.10 Port A (PA0 through PA7)
The port A is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register PACR and the function register PAFC. A reset allows all bits of the output latch PA to be set to "1," all bits of PACR and PAFC to be cleared to "0," and the port A to be put in input mode. Besides the input/output port function, the port A performs other functions: PA0 through PA5 input external interrupts and a 16-bit timer, and PA6 and PA7 perform a dial input function.
STOP/RESET drive disable
PAPE
(Pull-up control)
PACR
(Direction control)
RESET
PAFC
(Function control)
If the port A goes into STOP mode when the INT input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * Port: Inputs are accepted only during a read. * INT: Inputs are always accepted.
Internal data bus
PA
(Output latch)
PORT A PA0toPA5 (TB6IN0toTB8IN1, INT0toINT5)
1
0
PA read
TB6IN0toTB8IN1 INT0toINT5
NF (40ns typ)
Fig. 7-30 Port A (PA0 through PA5)
TMP19A43 (rev2.0) 7-48
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PAPE
(Pull-up control)
PACR
(Direction control)
Internal data bus
RESET
PAFC
(Function control)
PA
(Output latch)
Port A PA6,PA7 (TB2IN0,TB2IN1)
1
0
PA read
TB2IN0,TB2IN1 Fig. 7-31 Port A (PA6, PA7)
TMP19A43 (rev2.0) 7-49
Input/Output Ports
TMP19A43
7
PA (0xFFFF_F043) Bit Symbol Read/Write After reset PA7
6
PA6
Port A register 5 4
PA5 PA4 R/W
3
PA3
2
PA2
1
PA1
0
PA0
Input mode (output latch register is set to "1.")
7
PACR (0xFFFF_F047) Bit Symbol Read/Write After reset Function 0 PA7C
6
Port A control register 5 4
PA5C 0 PA4C R/W 0
3
PA3C 0
2
PA2C 0
1
PA1C 0
0
PA0C 0
PA6C 0
0: Input 1: Output
7
PAFC (0xFFFF_F04B) Bit Symbol Read/Write After reset Function 0 0: PORT
1: /TB2IN1
Port A function register 6 5 4
PA6F 0 0: PORT
1: /TB2IN0
3
PA3F R/W 0 0: PORT / INT3 1: INT3 /TB7IN1
2
PA2F 0 0: PORT / INT2 1: INT2 /TB7IN0
1
PA1F 0 0: PORT / INT1 1: INT1 /TB6IN1
0
PA0F 0 0: PORT / INT0 1: INT0 /TB6IN0
PA7F
PA5F 0 0: PORT / INT5 1: INT5 /TB8IN1
PA4F 0 0: PORT / INT4 1: INT4 /TB8IN0
7
PAPE (0xFFFF_F04F) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PEA7
Port A pull-up control register 6 5 4
PEA6 0 Pull-up 0: Off 1: Pull-Up PEA5 0 Pull-up 0: Off 1: Pull-Up PEA4 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PEA3 0
2
PEA2 0 Pull-up 0: Off 1: Pull-Up
1
PEA1 0 Pull-up 0: Off 1: Pull-Up
0
PEA0 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-50
Input/Output Ports
TMP19A43
7.11 Port B (PB0 to PB7)
Port B is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register PBCR and the function register PBFC. A reset allows all bits of the output latch PB to be set to "1," all bits of PBCR and PBFC to be cleared to "0," and the port B to be put in input mode. Besides the input/output port function, the port B performs other functions: PB2 and PB5 output HSIO data, PB3 and PB6 input HSIO data, PB4 and PB7 input and output HSIO HCLK or input HCTS, and PB0 and PB1 perform a 16-bit capture input function with a dial input function.
STOP/RESET drive disable
PBPE
(Pull-up control)
PBCR
(Direction control)
Internal data bus
RESET
PBFC
(Function control)
PB
(Output latch)
Port B PB0,PB1,PB3,PB6 (TB3IN0,TB3IN1) (HRXD0,HRXD1)
1
0
PB read
TB3IN0,TB3IN1 HRXD0,HRXD1 Fig. 7- 32 Port B (PB0, PB1)
TMP19A43 (rev2.0) 7-51
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PBPE
(Pull-up control)
PBCR
(Direction control)
Internal data bus
RESET
PBFC
(Function control)
HTXD0 HTXD1 1 PB
(Output latch)
0
PORT B PB2,PB5 (HTXD0,HTXD1)
PBODE
(Open drain)
1
0
PB read
Fig. 7-33 Port B (PB2, PB5)
TMP19A43 (rev2.0) 7-52
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PBPE
(Pull-up control)
PBCR
(Direction control)
Internal data bus
RESET
PBFC
(Function control)
HSCLK0 HSCLK1 1 port B PB4,PB7 (HSCLK0/HCTS0, HSCLK1/HCTS1)
PB
(Output latch)
0
PBODE
(Open drain)
1
0
PB read
HSCLK0/HCTS0, HSCLK1/HCTS1
Fig. 7-344 Port B (PB4, PB7)
TMP19A43 (rev2.0) 7-53
Input/Output Ports
TMP19A43
7
PB (0xFFFF_F050) Bit Symbol Read/Write After reset PB7
6
PB6
Port B register 5 4
PB5 PB4 R/W
3
PB3
2
PB2
1
PB1
0
PB0
Input mode (output latch register is set to "1.")
7
PBCR (0xFFFF_F054) Bit Symbol Read/Write After reset Function 0 PB7C
6
Port B control register 5 4
PB5C 0 PB4C R/W 0
3
PB3C 0
2
PB2C 0
1
PB1C 0
0
PB0C 0
PB6C 0
0: Input 1: Output
7
PBFC (0xFFFF_F058) Bit Symbol Read/Write After reset Function 0 0: PORT 1: HSCLK1 /HCTS1 PB7F
Port B function register 6 5 4
PB6F 0 0: PORT 1: HRXD1 PB5F 0 0: PORT 1: HTXD1 PB4F R/W 0 0: PORT 1: HSCLK0 /HCTS0
3
PB3F 0 0: PORT 1: HRXD0
2
PB2F 0 0: PORT 1: HTXD0
1
PB1F 0 0: PORT 1: TB3IN1
0
PB0F 0 0: PORT 1: TB3IN0
7
PBPE (0xFFFF_F05C) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PEB7
Port B pull-up control register 6 5 4
PEB6 0 Pull-up 0: Off 1: Pull-Up PEB5 0 Pull-up 0: Off 1: Pull-Up PEB4 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PEB3 0
2
PEB2 0 Pull-up 0: Off 1: Pull-Up
1
PEB1 0 Pull-up 0: Off 1: Pull-Up
0
PEB0 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
7
PBODE (0xFFFF_F034) Bit Symbol Read/Write After reset Function PB7ODE R/W 0 0: CMOS 1: Open drain
Port B open drain control register 6 5 4 3
- R 0 "0" is read. 0 0: CMOS 1: Open drain PB5ODE PB4ODE 0 0: CMOS 1: Open drain - R 0 "0" is read. R/W
2
PB2ODE R/W 0 0: CMOS 1: Open drain
1
- R 0 "0" is read.
0
TMP19A43 (rev2.0) 7-54
Input/Output Ports
TMP19A43
7.12 Port C (PC0 to PC7)
Port C is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register PCCR and the function register PCFC. A reset allows all bits of the output latch PC to be set to "1," all bits of PCCR and PCFC to be cleared to "0," and the port C to be put in input mode. Besides the input/output port function, the port C performs other functions: PC0 inputs external clock sources into a 32-bit time base timer and inputs the key-on wake-up, PC1 through PC4 perform the 32-bit compare output function, and PC5 through PC7 input and output SBI.
STOP/RESET drive disable KEY ch30 Pu-L UP
PCPE
(Pull-up control)
PCCR
(Direction control)
If the port C goes into STOP mode when the KEY/TBTIN input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * Port: Inputs are accepted only during a read. * KEY/TBTIN: Inputs are always accepted.
Internal data bus
RESET
PCFC
(Function control)
PC
(Output latch)
portC PC0 (TBTIN,KEY30)
1
0
PA read
TBTIN KEY30
NF (40ns typ)
Fig. 7-35 Port C (PC0)
TMP19A43 (rev2.0) 7-55
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PCPE
(Pull-up control)
PCCR
(Direction control)
Internal data bus
RESET
PCFC
(Function control) TCOUT0to TCOUT3
1
PC
(Output latch)
0
PORT C PC1toPC4 (TCOUT0toTCOUT3)
1
0
PCRead
Fig. 7- 36 Port C (PC1 through PC4)
TMP19A43 (rev2.0) 7-56
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PCPE
(Pull-up control)
PCCR
(Direction control)
Internal data bus
RESET
PCFC
(Function control) SO/SDA SCL SCK 1
PC
(Output latch)
0
Port C PC5,PC6,PC7 (SO/SDA, SI/SCL, SCK)
PCODE
(Open drain)
1
0
PCread SDA, SI/SCL SCK
Fig. 7-37 Port C (PC5-PC7)
TMP19A43 (rev2.0) 7-57
Input/Output Ports
TMP19A43
7
PC (0xFFFF_F051) Bit Symbol Read/Write After reset PC7
6
PC6
Port C register 5 4
PC5 PC4 R/W
3
PC3
2
PC2
1
PC1
0
PC0
Input mode (output latch register is set to "1.")
7
PCCR (0xFFFF_F055) Bit Symbol Read/Write After reset Function 0 PC7C
6
Port C control register 5 4
PC5C 0 PC4C R/W 0
3
PC3C 0
2
PC2C 0
1
PC1C 0
0
PC0C 0
PC6C 0
0: Input 1: Output
7
PCFC (0xFFFF_F059) Bit Symbol Read/Write After reset Function 0 0: PORT 1: SCK PC7F
Port C function register 6 5 4
PC6F 0 0: PORT 1: SI /SCL PC5F 0 0: PORT 1: SO /SDA0 PC4F R/W 0
3
PC3F 0
2
PC2F 0
1
PC1F 0
0
PC0F 0 0: PORT /KEY30 1: TBTIN /KEY30
0: PORT 0: PORT 0: PORT 0: PORT 1: TCOUT3 1: TCOUT2 1: TCOUT1 1: TCOUT0
7
PCPE (0xFFFF_F05D) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PEC7
Port C pull-up control register 6 5 4
PEC6 0 Pull-up 0: Off 1: Pull-Up PEC5 0 Pull-up 0: Off 1: Pull-Up PEC4 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PEC3 0
2
PEC2 0 Pull-up 0: Off 1: Pull-Up
1
PEC1 0 Pull-up 0: Off 1: Pull-Up
0
PEC0 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
7
PCODE (0xFFFF_F035) Bit Symbol Read/Write After reset Function PC7ODE R/W 0 0: CMOS 1: Open drain
Port C open drain control register 6 5 4 3
PC6ODE R/W 0 0: CMOS 1: Open drain PC5ODE R/W 0 0: CMOS 1: Open drain
2
- R 0 "0" is read.
1
0
TMP19A43 (rev2.0) 7-58
Input/Output Ports
TMP19A43
7.13 Port D (PD0 to PD6)
The port D is a general-purpose, 7-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register PDCR and the function register PDFC. A reset allows all bits of the output latch PD to be set to "1," all bits of PDCR and PDFC to be cleared to "0," and the port D to be put in input mode. Besides the input port function, the port D performs other functions: PD0 outputs HSIO data, PD1 inputs HSIO data, PD2 inputs and outputs HSIO HCLK or inputs HCTS, PD3, PD4 and PD5 output a 16-bit timer, and PD6 inputs the key-on wake-up and A/D triggers into the A/D converter.
STOP/RESET drive disable
PDPE
(Pull-up control)
PDCR
(Direction control)
Internal data bus
RESET
PDFC
(Function control)
HTXD2 PD
(Output latch)
1 PORT D PD0 (HTXD2)
0
PDODE
(Open drain)
1
0
PD READ
Fig. 7-38 Port D (PD0)
TMP19A43 (rev2.0) 7-59
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PDPE
(Pull-up control)
PDCR
(Direction control)
Internal data bus
RESET
PDFC
(Function control)
PD
(Output latch)
PORT D PD1 (HRXD2)
1
0
PD read
Fig. 7-39 Port D (PD1)
TMP19A43 (rev2.0) 7-60
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PDPE
(Pull-up control)
PDCR
(Direction control)
Internal data bus
RESET
PDFC
(Function control)
HSCLK2 PD
(Output latch)
1 PORT D PD2 0 (HSCLK2/ HCTS2 )
PDODE
(Open drain)
1
0
PD Read
HSCLK2 HCTS2
Fig. 7-40 Port D (PD2)
TMP19A43 (rev2.0) 7-61
Input/Output Ports
TMP19A43
STOP/RESET drive disable
PDPE
(Pull-up control)
PDCR
(Direction control)
Internal data bus
RESET
PDFC
(Function control) TBOUTB TBOUTC TBOUTD
1
PD
(Output latch)
0
PORT D PD3toPD5 (TBOUTB TBOUTC TBOUTD)
1
0
PD READ
Fig. 7- 41 Port D (PD3 through PD5)
TMP19A43 (rev2.0) 7-62
Input/Output Ports
TMP19A43
STOP/RESET drive disable
KEY ch31 pull-up
PDPE
(Pull-up control)
PDCR
(Direction control)
If the port D goes into STOP mode when the KEY/ADTRG input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * Port: Inputs are accepted only during a read. * KEY/ADTRG: Inputs are always accepted.
Internal data bus
RESET
PDFC
(Function control)
PD
(Output latch)
PORT D PD6 (ADTRG,KEY31)
1
0
PD READ
ADTRG KEY31
NF (40ns typ)
Fig. 7- 42 Port D (PD6)
TMP19A43 (rev2.0) 7-63
Input/Output Ports
TMP19A43
7
PD (0xFFFF_F052) Bit Symbol Read/Write After reset R 0
6
PD6
Port D register 5 4
PD5 PD4
3
PD3 R/W
2
PD2
1
PD1
0
PD0
Input mode (output latch register is set to "1.")
7
PDCR (0xFFFF_F056) Bit Symbol Read/Write After reset Function R 0
6
Port D control register 5 4
PD5C 0 PD4C 0
3
PD3C R/W 0
2
PD2C 0
1
PD1C 0
0
PD0C 0
PD6C 0
0: Input 1: Output
7
PDFC (0xFFFF_F05A) Bit Symbol Read/Write After reset Function - R 0 "0" is read.
Port D function register 6 5 4
PD6F 0 PD5F 0 PD4F 0
3
PD3F R/W 0
2
PD2F 0 0: PORT 1: HSCLK2/ HCTS2
1
PD1F 0 0: PORT 1: HRXD2
0
PD0F 0 0: PORT 1: HTXD2
0: PORT 0: PORT 0: PORT 0: PORT /KEY31 1: TBDOUT 1: TBCOUT 1: TBBOUT 1: ADTRG /KEY31
7
PDPE (0xFFFF_F05E) Bit Symbol Read/Write After reset Function R 0 A written value can be read.
Port D pull-up control register 6 5 4
PED6 0 Pull-up 0: Off 1: Pull-Up PED5 0 Pull-up 0: Off 1: Pull-Up PED4 0 Pull-up 0: Off 1: Pull-Up
3
PED3 R/W 0
2
PED2 0 Pull-up 0: Off 1: Pull-Up
1
PED1 0 Pull-up 0: Off 1: Pull-Up
0
PED0 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
7
PDODE (0xFFFF_F036) Bit Symbol Read/Write After reset Function
Port D open drain control register 6 5 4 3
- R 0 "0" is read.
2
PD2ODE R/W 0 0: CMOS 1: Open drain
1
- R 0 "0" is read.
0
PD0ODE R/W 0 0: CMOS 1: Open drain
TMP19A43 (rev2.0) 7-64
Input/Output Ports
TMP19A43
7.14 Port E (PE0 through PE7)
The port E is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register PECR and the function register PEFC. A reset allows all bits of the output latch PE to be set to "1," all bits of PECR and PEFC to be cleared to "0," and the port E to be put in input mode. Besides the input/output port function, the port E performs the key-on wake-up input function.
KEY ch8toKEY15 STOP/RESET drive disable pull-up
PEPE
(Pull-up control)
PECR
(Direction control)
If the port E goes into STOP mode when the KEY input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register * Port: Inputs are accepted only during a read. * KEY: Inputs are always accepted.
Internal data bus
RESET
PEFC
(Function control)
PE
(Output latch)
PORT E PE0toPE7 (KEY8toKEY15)
1
0
PE READ
KEY8toKEY15
NF (40ns typ)
Fig. 7- 43 Port E (PE0 through PE7)
TMP19A43 (rev2.0) 7-65
Input/Output Ports
TMP19A43
7
PE (0xFFFF_F053) Bit Symbol Read/Write After reset PE7
6
PE6
Port E register 5 4
PE5 PE4 R/W
3
PE3
2
PE2
1
PE1
0
PE0
Input mode (output latch register is set to "1.")
7
PECR (0xFFFF_F057) Bit Symbol Read/Write After reset Function 0 PE7C
6
Port E control register 5 4
PE5C 0 PE4C R/W 0
3
PE3C 0
2
PE2C 0
1
PE1C 0
0
PE0C 0
PE6C 0
0: Input 1: Output
7
PEFC (0xFFFF_F05B) Bit Symbol Read/Write After reset Function 0 0: PORT / KEY15 1: KEY15 PE7F
Port E function register 6 5 4
PE6F 0 0: PORT / KEY14 1: KEY14 PE5F 0 0: PORT / KEY13 1: KEY13 PE4F R/W 0 0: PORT / KEY12 1: KEY12
3
PE3F 0 0: PORT / KEY11 1: KEY11
2
PE2F 0 0: PORT / KEY10 1: KEY10
1
PE1F 0 0: PORT / KEY09 1: KEY09
0
PE0F 0 0: PORT / KEY08 1: KEY08
7
PEPE (0xFFFF_F05F) Bit Symbol Read/Write After reset Function 0
Pull-up
Port E pull-up control register 6 5 4
PEE6 0
Pull-up
3
PEE3
2
PEE2 0
Pull-up
1
PEE1 0
Pull-up
0
PEE0 0
Pull-up
PEE7
PEE5 0
Pull-up
PEE4 R/W 0
Pull-up
0
Pull-up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-66
Input/Output Ports
TMP19A43
7.15 Port F (PF0 through PF7)
The port F is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register PFCR and the function register PFFC. A reset allows all bits of the output latch PF to be set to "1," all bits of PFCR and PFFC to be cleared to "0," and the port F to be put in input mode. Besides the input/output port function, the port F performs the key-on wake-up input function, PF0 through PF3 perform a 32-bit timer capture input function, and PF4 through PF7 perform a 32-bit timer compare output function.
STOP/RESET drive disable KEY ch16,18 pull-up
PFPE
(Pull-up control)
PFCR
(Direction control)
If the port F goes into STOP mode when the KEY/DREQ input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * Port: Inputs are accepted only during a read. * KEY/DREQ: Inputs are always accepted.
Internal data bus
RESET
PFFC
(Function control)
PF
(Output latch)
PORT F PF0,PF2 ( DREQ0 , DREQ4 KEY16,KEY18)
1
0
PF read
DREQ0 , DREQ4
NF (40ns typ)
Fig. 7-44 Port F (PF0, PF2)
TMP19A43 (rev2.0) 7-67
Input/Output Ports
TMP19A43
KEY17,KEY19 STOP/RESET drive disable Ch20toKEY23 pull-up
PFPE
(Pull-up control)
PFCR
(Direction control)
If the port F goes into STOP mode when the KEY input is enabled, inputs are always accepted. To inhibit inputs, switch to PORT using the function register. * Port: Inputs are accepted only during a read. * KEY: Inputs are always accepted.
Internal data bus
RESET
PFFC
(Function control)
PF
(Output latch) DACK0,DACK4, TCOUT4to7
0 1
1
port F PF1,PF3 PF4toPF7 (DACK0,DACK4, TCOUT4to7) (KEY17,KEY19 KEY20toKEY23)
0
PF READ
KEY17,KEY19 KEY20toKEY23
NF (40ns typ)
Fig. 7-45 Port F (PF1, PF3,PF4-PF7)
TMP19A43 (rev2.0) 7-68
Input/Output Ports
TMP19A43
7
PF (0xFFFF_F060) Bit Symbol Read/Write After reset PF7
6
PF6
Port F register 5 4
PF5 PF4 R/W
3
PF3
2
PF2
1
PF1
0
PF0
Input mode (output latch register is set to "1.")
7
PFCR (0xFFFF_F064) Bit Symbol Read/Write After reset Function 0 PF7C
6
Port F control register 5 4
PF5C 0 PF4C R/W 0
3
PF3C 0
2
PF2C 0
1
PF1C 0
0
PF0C 0
PF6C 0
0: Input 1: Output
7
PFFC (0xFFFF_F068) Bit Symbol Read/Write After reset Function 0 0: PORT / KEY23
1: TCOUT7
Port F function register 6 5 4
PF6F 0 0: PORT / KEY22
1: TCOUT6
3
PF3F R/W 0 0: PORT /KEY19 1: DACK4 /KEY19
2
PF2F 0 0: PORT /KEY18 1: DREQ4 /KEY18
1
PF1F 0 0: PORT /KEY17 1: DACK0 /KEY17
0
PF0F 0 0: PORT /KEY16 1: DREQ0 /KEY16
PF7F
PF5F 0 0: PORT /KEY21 1: TCOUT5 /KEY21
PF4F 0 0: PORT /KEY20
1: TCOUT4
/ KEY23
/ KEY22
/KEY20
7
PFPE (0xFFFF_F06C) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PEF7
Port F pull-up control register 6 5 4
PEF6 0 Pull-up 0: Off 1: Pull-Up PEF5 0 Pull-up 0: Off 1: Pull-Up PEF4 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PEF3 0
2
PEF2 0 Pull-up 0: Off 1: Pull-Up
1
PEF1 0 Pull-up 0: Off 1: Pull-Up
0
PEF0 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-69
Input/Output Ports
TMP19A43
7.16 Port G (PG0 through PG7)
The port G is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register PGCR and the function register PGFC. A reset allows all bits of the output latch PG to set to "1," all bits of PGCR and PGFC to be cleared to "0," and the port G to be put in input mode. Besides the input/output port function, the port G outputs data tracing signals for debugging. The port G gets ready to output data tracing signals according the debug level, independent of the register setting. If DSU-ICE is to be used for debugging, the port G outputs the signal for EJTAG. Therefore, it is recommended not to use the port G as an input/output port.
STOP/RESET drive disable
PGPE
(Pull-up control)
PGCR
(Direction control)
Internal data bus (Note)
RESET
PG
(Output latch)
PORT G PG0toPG7
1
0
PG read
Fig. 7-46 Port G (PG0 through PG7)
The above system diagram does not show the debug function.
TMP19A43 (rev2.0) 7-70
Input/Output Ports
TMP19A43
7
PG (0xFFFF_F061) Bit Symbol Read/Write After reset PG7
6
PG6
Port G register 5 4
PG5 PG4 R/W
3
PG3
2
PG2
1
PG1
0
PG0
Input mode (output latch register is set to "1.")
7
PGCR (0xFFFF_F065) Bit Symbol Read/Write After reset Function 0 PG7C
6
Port G control register 5 4
PG5C 0 PG4C R/W 0
3
PG3C 0
2
PG2C 0
1
PG1C 0
0
PG0C 0
PG6C 0
0: Input 1: Output
7
PGPE (0xFFFF_F06D) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PEG7
Port G pull-up control register 6 5 4
PEG6 0 Pull-up 0: Off 1: Pull-Up PEG5 0 Pull-up 0: Off 1: Pull-Up PEG4 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PEG3 0
2
PEG2 0 Pull-up 0: Off 1: Pull-Up
1
PEG1 0 Pull-up 0: Off 1: Pull-Up
0
PEG0 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
Level 0 PG Port PH Port PORT PORT
Level 1 PORT TPC
Level 2 PGFC = 0 PGFC = 1 PGFC = 0 PGFC = 1 PORT TPD TPD PORT
Level 3 TPD TPC
Table 7-7 Pin states of the ports G and H relative to debug levels * When EJTAG is used, the PGFC setting is made using a tool.
TMP19A43 (rev2.0) 7-71
Input/Output Ports
TMP19A43
7.17 Port H (PH0 through PH7)
The port H is a general-purpose, 8-bit input/output port. For this port, inputs and outputs can be specified in units of bits by using the control register PHCR. A reset allows all bits of the output latch PH to be set to "1," all bits of PHCR to be cleared to "0," and the port H to be put in input mode. Besides the port function, the port H outputs TPC/TPD of DSU, and is determined by the levels of PGFC and EJTAG. If DSU-ICE is used for debugging, the port H outputs the signal for EJTAG. Therefore, it is recommended not to use the port H as an input/output port.
STOP/RESET drive disable
PHPE
(Pull-up control)
PHCR
(Direction control)
Internal data bus (Note)
RESET
PH
(Output latch)
PORT H PH0toPH7
1
0
PHRead
Fig. 7-47 Port H (PH0 through PH7)
The above system diagram does not show the debug function.
TMP19A43 (rev2.0) 7-72
Input/Output Ports
TMP19A43
7
PH (0xFFFF_F062) Bit Symbol Read/Write After reset PH7
6
PH6
Port H register 5 4
PH5 PH4 R/W
3
PH3
2
PH2
1
PH1
0
PH0
Input mode (output latch register is set to "1.")
7
PHCR (0xFFFF_F066) Bit Symbol Read/Write After reset Function 0 PH7C
6
Port H control register 5 4
PH5C 0 PH4C W 0
3
PH3C 0
2
PH2C 0
1
PH1C 0
0
PH0C 0
PH6C 0
<>
7
PHPE (0xFFFF_F06E) Bit Symbol Read/Write After reset Function 0 Pull-up 0: Off 1: Pull-Up PEH7
Port H pull-up control register 6 5 4
PEH6 0 Pull-up 0: Off 1: Pull-Up PEH5 0 Pull-up 0: Off 1: Pull-Up PEH4 R/W 0 Pull-up 0: Off 1: Pull-Up
3
PEH3 0
2
PEH2 0 Pull-up 0: Off 1: Pull-Up
1
PEH1 0 Pull-up 0: Off 1: Pull-Up
0
PEH0 0 Pull-up 0: Off 1: Pull-Up
Pull-up 0: Off 1: Pull-Up
TMP19A43 (rev2.0) 7-73
Input/Output Ports
TMP19A43
8.
External Bus Interface
The TMP19A43 has a built-in external bus interface function to connect to external memory, I/Os, etc. This interface consists of an external bus interface circuit (EBIF), a chip selector (CS) and a wait controller. The chip selector and wait controller designate mapping addresses in a 4-block address space and also control wait states and data bus widths (8- or 16-bit) in these and other external address spaces. The external bus interface circuit (EBIF) controls the timing of external buses based on the chip selector and wait controller settings. The EBIF also controls the dynamic bus sizing and the bus arbitration with the external bus master. External bus mode Selectable address, data separator bus mode and multiplex mode Wait function This function can be enabled for each block. * * A wait of up to 7 clocks can be automatically inserted. A wait can be inserted via the WAIT / RDY pin.
Data bus width Either an 8- or 16-bit width can be set for each block. Recovery cycle (read/write) If an external bus cycle is in progress, a dummy cycle of up to 2 clocks can be inserted and this dummy cycle can be specified for each block. Recovery cycle (chip selector) When an external bus is selected, a dummy cycle of up to 1 clock can be inserted and this dummy cycle can be specified for each block. Bus arbitration function
TMP19A43 (rev2.0) 8-1
External Bus Interface
TMP19A43
8.1 Address and Data Pins
(1) Address and data pin settings The TMP19A43 can be set to either separate bus or multiplexed bus mode. Setting the BUSMD pin (port P45) to the "L" level (DVSS) at a reset activates the separate bus mode, and setting the pin to the "H" level (DVCC3)activates the multiplexed bus mode. Port pins 0, 1, 2, 5 and 6, which are to be connected to external devices (memory), are used as address buses, data buses and address/data buses. Table 8-1 shows these. Table 8-1 Bus Mode, Address and Data Pins
Separate BUSMD="L" Port 0 (P00 to P07) Port 1 (P10 to P17) Port 2 (P20 to P27) Port 5 (P50 to P57) Port 6 (P60 to P67) Port 37 (P37) D0-D7 D8-D15 A16-A23 A0-A7 A8-A15 General-purpose port Multiplex BUSMD="H" AD0-AD7 AD8-AD15/A8-A15 A0-A7/A16-A23 General-purpose port General-purpose port ALE
Each port is put into input mode after a reset. To access an external device, set the address and data bus functions by using the port control register (PnCR) and the port function register (PnFC). In the multiplex mode, the four types of functions can be selected, as shown in Table 8-2, by setting the port registers (PnCR and PnFC). Table 8-2 Address and Data Pins in the Multiplex Mode
Number of address buses Number of data buses Number of address/data multiplexed buses Port 0 Port Port 1 function Port 2 max.24 (-16 MB) 8 8 AD0 to AD7 A8 to A15 A16 to A23 max.24 (-16 MB) 16 16 AD0 to AD7 AD8 to AD15 A16 to A23 max.16 (-64 KB) 8 0 AD0 to AD7 A8 to A15 A0 to A7 max.8 (-256 B) 16 0 AD0 to AD7 AD8 to AD15 A0 to A7
A23-8
A23-8
A23-16
A23-16 A15 -0 D15 -0
A15-0 AD7-0
A15-0 (Note 1)
A7-0
A7-0 (Note 1) A15 D15 -0 -0
AD7-0
A7-0
D7-0
AD15-0
A7-0
D7-0
AD15-0
Timing Diagram
ALE ALE ALE ALE
RD
RD
RD
RD
(Note 1) Even in cases of buses.
and
, address outputs are available as the data bus pins are also used for address
(Note 2) Ports 0 to 2 are put into input modes after a reset, and they do not serve as address or data bus pins. (Note 3) Port 0 automatically becomes a data and address/data bus pin when an external memory is being accessed. (Note 4) Any of to can be selected by setting the P1CR, P1FC, P2CR and P2FC registers.
TMP19A43 (rev2.0) 8-2
External Bus Interface
TMP19A43
(2) Address HOLD when an internal area is accessed When an internal area is being accessed, the address bus maintains the address output of the previously accessed external area and doesn't change it. Also, the data bus is in a state of high impedance.
8.2 Data Format
Internal registers and external bus interfaces of the TMP19A43 are configured as described below. (1) Big-endian mode Word access * 16-bit bus width Internal registers
address x0 x1 x2 x3
External buses
D31 AA BB CC D00 DD
AABB MSB LSB A1=0
CCDD A1=1
8-bit bus width Internal registers
address x0 x1 x2 x3
External buses
D31 AA BB CC D00 DD
AA x0
BB x1
CC x2
DD x3
Half word access * 16-bit bus width Internal registers
address D31 AA x0 D00 BB x1 address D31 CC x2 D00 DD x3 CCDD MSB LSB AABB MSB LSB
External buses
TMP19A43 (rev2.0) 8-3
External Bus Interface
TMP19A43
*
8-bit bus width Internal registers
address D31 AA x0 D00 BB x1 AA x0 BB x1
External buses
Internal registers
address D31 CC x2 D00 DD x3
External buses
CC x2
DD x3
Byte access * 16-bit bus width Internal registers
address D31 AA MSB LSB D00 AA x0 address D31 BB MSB LSB D00 BB x1 address D31 CC MSB LSB D00 CC x2 address D31 DD MSB LSB D00 DD x3
External buses
TMP19A43 (rev2.0) 8-4
External Bus Interface
TMP19A43
8-bit bus width Internal registers
address D31 AA D00 AA x0 address D31 BB D00 BB x1 address D31 CC D00 CC x2 address D31 DD D00 DD x3
External buses
TMP19A43 (rev2.0) 8-5
External Bus Interface
TMP19A43
(2) Little-endian mode Word access * 16-bit bus width Internal registers
address x3 x2 x1 x0
External buses
D31 DD CC BB D00 AA
AABB CCDD LSB MSB A1=0 A1=1
*
8-bit bus width Internal registers
address x3 x2 x1 x0
External buses
D31 DD CC BB D00 AA
AA x0
BB x1
CC x2
DD x3
Half word access * 16-bit bus width Internal registers
address D31 BB x1 D00 AA x0 AABB LSB MSB
External buses
address D31 DD x3 D00 CC x2 CCDD LSB MSB
TMP19A43 (rev2.0) 8-6
External Bus Interface
TMP19A43
*
8-bit bus width Internal registers
address D31 BB x1 D00 AA x0 AA x0 BB x1
External buses
Internal registers
address D31 DD x3 D00 CC x2
External buses
CC x2
DD x3
Byte access * 16-bit bus width Internal registers
address D31 AA LSB D00 AA x0 address D31 LSB D00 BB x1 address D31 CC LSB D00 CC x2 address D31 LSB D00 DD x3 DD MSB MSB BB MSB MSB
External buses
TMP19A43 (rev2.0) 8-7
External Bus Interface
TMP19A43
*
8-bit bus width Internal registers
address D31 AA D00 AA x0 address D31 BB D00 BB x1 address D31 CC D00 CC x2 address D31 DD D00 DD x3
External buses
TMP19A43 (rev2.0) 8-8
External Bus Interface
TMP19A43
8.3 External Bus Operations (Separate Bus Mode)
This section describes various bus timing values. The timing diagram shown below assumes that the address buses are A23 through A0 and that the data buses are D15 through D0. (1) Basic bus operation The external bus cycle of the TMP19A43 basically consists of three clock pulses and a wait can be inserted as mentioned later. The basic clock of an external bus cycle is the same as the internal system clock. Fig. 8-1 shows read bus timing and Fig. 8-2 shows write bus timing. If internal areas are accessed, address buses remain unchanged as shown in these figures. Additionally, data buses are in a state of high impedance and control signals such as RD and WR do not become active.
tsys
CSn
A [23:0] D [15:0] DATA
Address HOLD Output High - Z
RD
External access
No output of RD Internal access
Fig. 8-1 Read Operation Timing Diagram
tsys
CSn
A [23:0] D [15:0] DATA
Address HOLD Output High - Z
WR
External access
No output of WR Internal access
Fig. 8-2 Write Operation Timing Diagram
TMP19A43 (rev2.0) 8-9
External Bus Interface
TMP19A43
(2) Wait timing A wait cycle can be inserted for each block by using the chip selector (CS) and wait controller. The following three types of wait can be inserted: A wait of up to 7 clocks can be automatically inserted. A wait can be inserted via the WAIT pin (2+2N, 3+2N, 4+2N, 5+2N, 6+2N, 7+2N). Note: 2N is the number of external waits that can be inserted. A wait can be inserted via the RDY pin (2+2N, 3+2N, 4+2N, 5+2N, 6+2N, 7+2N). Note: 2N is the number of external waits that can be inserted. The setting of the number of waits to be automatically inserted and the setting of the external wait input can be made using the chip selector and wait controller registers, BmnCS. Fig. 8-3 through Fig. 8-10 show the timing diagrams in which waits have been inserted.
tsys
A[23:0] D[15:0] RD
address data
address data
0 wait
1 wait
Fig. 8-3 Read Operation Timing Diagram (0 Wait and 1 Wait Automatically Inserted)
tsys
A[23:0] D[15:0] RD
address data
5 waits
Fig. 8-4 Read Operation Timing Diagram (5 Waits Automatically Inserted)
TMP19A43 (rev2.0) 8-10
External Bus Interface
TMP19A43
Fig. 8-5 shows the read operation timing when 0 wait, waits automatically inserted, and waits automatically inserted + external waits are inserted in the separate bus mode.
tsys fsys 0 wait A[23:0] D[15:0] /RD /WAIT 2 waits automatically inserted A[23:0] D[15:0] /RD /WAIT
2 waits automatically inserted
2 waits automatically inserted + 2N (N=1) A[23:0] D[15:0] /RD /WAIT
2 waits automatically inserted
2N_WAIT
3 waits automatically inserted + 2N (N=1) A[23:0] D[15:0] /RD /WAIT
3 waits automatically inserted
2N_WAIT
2 waits automatically inserted + 2N (N=2) A[23:0] D[15:0] /RD /WAIT
2 waits automatically inserted
2N_WAIT
--- External wait sampling point External wait sampling points take place before a cycle of waits automatically inserted is finished and before a 2N_wait cycle is finished as shown above. The same applies to combinations of other numbers of waits.
Fig. 8-5 Read Operation Timing Diagram
TMP19A43 (rev2.0) 8-11
External Bus Interface
TMP19A43
Fig. 8-6 shows the write operation timing when 0 wait, waits automatically inserted, and waits automatically inserted + external waits are inserted in the separate bus mode.
tsys
fsys 0 wait A[23:0] D[15:0] /WR /WAIT 2 waits automatically inserted A[23:0] D[15:0] /WR /WAIT
2 waits automatically inserted
2 waits automatically inserted + 2N (N=1) A[23:0] D[15:0] /WR /WAIT
3 waits automatically inserted + 2N (N=1) A[23:0] D[15:0] /WR /WAIT
2 waits automatically inserted
2N_WAIT
3 waits automatically inserted
2N_WAIT
2 waits automatically inserted + 2N (N=2) A[23:0] D[15:0] /WR /WAIT
2 waits automatically inserted 2N_WAIT
--- External wait sampling point External wait sampling points take place before a cycle of waits automatically inserted is finished and before a 2N_wait cycle is finished as shown above. The same applies to combinations of other numbers of waits.
Fig. 8-6 Write Operation Timing Diagram
TMP19A43 (rev2.0) 8-12
External Bus Interface
TMP19A43
By setting the bit 3 of port 3 function register P3FC to "1," the WAIT input pin (P33) can also serve as the RDY input pin. The RDY input is input to the external bus interface circuit as the logical reverse of the WAIT input. The number of waits is specified by the chip selector and wait controller register, BmnCS. Fig. 8-7 shows the RDY inputs and the number of waits.
tsys
fsys 2 waits automatically inserted A[23:0] D[15:0] /RD /RDY
2 waits automatically inserted
2 waits automatically inserted + 2N (N=1) A[23:0] D[15:0] /RD /RDY
2 waits automatically inserted 2N_WAIT
--- External RDY sampling point External RDY sampling points take place before a cycle of waits automatically inserted is finished and before a 2N_wait cycle is finished as shown above. The same applies to combinations of other numbers of waits.
Fig. 8-7 RDY Input and Wait Operation Timing Diagram
TMP19A43 (rev2.0) 8-13
External Bus Interface
TMP19A43
(3) Time that it takes before ALE is asserted When the external bus of the TMP19A43 is used as a multiplexed bus, the ALE width (assert time) can be specified by using the system control register SYSCR3 in the CG. In the case of a separate bus mode, ALE is not output, but the time from when an address is established to the assertion of the RD or
WR signal is different depending on the SYSCR3.
During a reset, = "1" is set and the RD or WR signal is asserted as a point of two system
(internal) clocks after an address is established. If is cleared to "0," the RD or WR signal is asserted at a point of one system (internal) clock after an address is established. This assert setting cannot be established for each block in an external area and the same setting is commonly used in an external address space.
tsys
A[23:0] D[15:0] RD
address data
address data
="0"
="1"
Fig. 8-8 SYSCR3 Set Value and External Bus Operation
TMP19A43 (rev2.0) 8-14
External Bus Interface
TMP19A43
(4) Recovery time If access to external areas occurs consecutively, a dummy cycle can be inserted for recovery time. A dummy cycle can be inserted in both a read and a write cycle. The dummy cycle insertion setting can be made in the chip selector and wait controller registers, BmnCS (write recovery cycle) and (read recovery cycle). As for the number of dummy cycles, one or two system clocks (internal) can be specified for each block. Fig. 8-9 shows the timing of recovery time insertion.
tsys
CS A[23:0] RD WR No recovery cycle address next address
CS A[23:0] RD WR 1 recovery cycle 2 recovery cycles address next address
Fig. 8-9 Timing of Recovery Time Insertion
TMP19A43 (rev2.0) 8-15
External Bus Interface
TMP19A43
(5) Chip selector recovery time If access to external areas occurs consecutively, a dummy cycle can be inserted for recovery time. The dummy cycle insertion setting can be made in the chip selector and wait controller registers, BmnCS. As for the number of dummy cycles, one system clock (internal) can be specified for each block. Fig. 8-10 shows the timing of recovery time insertion.
tsys
CS A[23:0] RD WR No recovery cycle 1 recovery cycle address next address
Fig. 8-10 Timing of Recovery Time Insertion
TMP19A43 (rev2.0) 8-16
External Bus Interface
TMP19A43
8.4 External Bus Operations (Multiplexed Bus Mode)
This section describes various bus timing values. The timing diagram shown below assumes that the address buses are A23 through A16 and that the address/data buses are AD15 through AD0. (1) Basic bus operation The external bus cycle of the TMP19A43 basically consists of three clock pulses and a wait can be inserted as mentioned later. The basic clock of an external bus cycle is the same as the internal system clock. Fig. 8-11 shows read bus timing and Fig. 8-12 shows write bus timing. If internal areas are accessed, address buses remain unchanged and the ALE does not output latch pulse as shown in these figures. Additionally, address/data buses are in a state of high impedance and control signals such as RD and WR do not become active.
tsys
CSn
A [23:16] AD [15:0] ALE DATA
Higher-order address HOLD Output Hi - Z ADR
No output of ALE No output of RD External access Internal access
RD
Fig. 8-11 Read Operation Timing Diagram
tsys
CSn
A [23:16] AD [15:0] ALE ADR DATA
Higher-order address HOLD
Output Hi - Z
No output of ALE
WR
External area
No output of WR Internal area
Fig. 8-12 Write Operation Timing Diagram
TMP19A43 (rev2.0) 8-17
External Bus Interface
TMP19A43
(2) Wait Timing A wait cycle can be inserted for each block by using the chip selector (CS) and wait controller. The following three types of wait can be inserted: A wait of up to 7 clocks can be automatically inserted. A wait can be inserted via the WAIT pin (2+2N, 3+2N, 4+2N, 5+2N, 6+2N, 7+2N). Note: 2N is the number of external waits that can be inserted. A wait can be inserted via the RDY pin (2+2N, 3+2N, 4+2N, 5+2N, 6+2N, 7+2N). Note: 2N is the number of external waits that can be inserted.
The setting of the number of waits to be automatically inserted and the setting of the external wait input can be made using the chip selector and wait controller registers, BmnCS.
TMP19A43 (rev2.0) 8-18
External Bus Interface
TMP19A43
Fig. 8-13 shows the read operation timing when 0 wait, waits automatically inserted, and waits automatically inserted + external waits are inserted in the multiplexed bus mode.
tsys fsys 0 wait A[23:16] AD[15:0] ALE /RD /WAIT 2 waits automatically inserted A[23:16] AD[15:0] ALE /RD /WAIT 2 waits automatically inserted 2 waits automatically inserted + 2N (N=1) A[23:16] AD[15:0] ALE /RD /WAIT 2 waits automatically inserted 3 waits automatically inserted + 2N (N=1) A[23:16] AD[15:0] ALE /RD /WAIT 3 waits automatically inserted 2 waits automatically inserted + 2N (N=2) A[23:16] AD[15:0] ALE /RD /WAIT 2 waits automatically inserted 2N_WAIT
Lower-order address Higher-order address Data Lower-order address Higher-order address Data Lower-order address Higher-order address Data Lower-order address Higher-order address Data Lower-order address Higher-order address Data
2N_WAIT
2N_WAIT
--- External wait sampling point External wait sampling points take place before a cycle of waits automatically inserted is finished and before a 2N_wait cycle is finished as shown above. The same applies to combinations of other numbers of waits.
Fig. 8-13 Read Operation Timing Diagram
TMP19A43 (rev2.0) 8-19
External Bus Interface
TMP19A43
Fig. 8-14 shows the write operation timing when 0 wait, waits automatically inserted, and waits automatically inserted + external waits are inserted in the multiplexed bus mode.
tsys fsys 0 wait A[23:16] AD[15:0] ALE /WR /WAIT 2 waits automatically inserted A[23:16] AD[15:0] ALE /WR /WAIT 2 waits automatically inserted 2 waits automatically inserted + 2N (N=1) A[23:16] AD[15:0] ALE /WR /WAIT 2 waits automatically inserted 3 waits automatically inserted + 2N (N=1) A[23:16] AD[15:0] ALE /WR /WAIT 2 waits automatically inserted 2 waits automatically inserted + 2N (N=2) A[23:16] AD[15:0] ALE /WR /WAIT 2 waits automatically inserted 2N_WAIT
Lower-order address Higher-order address Data Lower-order address Higher-order address Data Lower-order address Higher-order address Data Lower-order address Higher-order address Data Lower-order address Higher-order address Data
2N_WAIT
2N_WAIT
--- External wait sampling point External wait sampling points take place before a cycle of waits automatically inserted is finished and before a 2N_wait cycle is finished as shown above. The same applies to combinations of other numbers of waits.
Fig. 8-14 Write Operation Timing Diagram
TMP19A43 (rev2.0) 8-20
External Bus Interface
TMP19A43
(3) Time that it takes before ALE is asserted Either 1 clock or 2 clocks can be selected as the time that it takes before ALE is asserted. The setting bit is located in the system clock control register. The default is 2 clocks. This assert setting cannot be established for each block in an external area and the same setting is commonly used in an external address space.
tsys
ALE (ALESEL = 0) 1 clock AD [15:0]
(ALESEL = 1) 2 clocks AD [15:0]
Fig. 8-15 Time That It Takes Before ALE Is Asserted Fig. 8-16 shows the timing when the ALE is 1 clock or 2 clocks.
When the ALE is 1 clock or 2 clocks
tsys fsys
A[23:16] AD[15:0] ALE /RD
Higher-order address Lower-order address Data
Higher-order address Data
Fig. 8-16 Read Operation Timing Diagram (When the ALE is 1 Clock or 2 Clocks)
TMP19A43 (rev2.0) 8-21
External Bus Interface
TMP19A43
(4) Read and Write Recovery Time If access to external areas occurs consecutively, a dummy cycle can be inserted for recovery time. A dummy cycle can be inserted in both a read and a write cycle. The dummy cycle insertion setting can be made in the chip selector and wait controller registers, BmnCS (write recovery cycle) and (read recovery cycle). As for the number of dummy cycles, one or two system clocks (internal) can be specified for each block. Fig. 8-17 shows the timing of recovery time insertion.
When read/write recovery is inserted (ALE width:1fsys)
tsys fsys A[23:16] AD[15:0] ALE /CS /RD,/WR Dummy cycle Normal cycle 1 recovery cycle 2 recovery cycles Dummy cycle
Higher-order address Lower-order address Data Higher-order address Lower-order address Data Higher-order address Lower-order address Data
Fig. 8-17 Timing of Recovery Time Insertion
TMP19A43 (rev2.0) 8-22
External Bus Interface
TMP19A43
(5) Chip selector recovery time If access to external areas occurs consecutively, a dummy cycle can be inserted for recovery time. The dummy cycle insertion setting can be made in the chip selector and wait controller registers, BmnCS. As for the number of dummy cycles, one system clock (internal) can be specified for each block. Fig. 8-18 shows the timing of recovery time insertion.
When chip selector recovery is inserted (ALE width:1fsys) tsys fsys A[23:16] AD[15:0] ALE /CS /RD,/WR
Lower-order address
Higher-order address Data Lower-order address
Higher-order address Data
Dummy cycle Normal cycle Chip selector recovery cycle
Fig. 8-18 Timing of Recovery Time Insertion
TMP19A43 (rev2.0) 8-23
External Bus Interface
TMP19A43
8.5 Bus Arbitration
The TMP19A43 can be connected to an external bus master. The arbitration of bus control authority with the external bus master is executed by using the two signals, BUSRQ and BUSAK . The external bus master can
acquire control authority for TMP19A43 external buses only, and cannot acquire control authority for internal buses.
(1) Accessible range of external bus master The external bus master can acquire control authority for TMP19A43 external buses only, and cannot acquire control authority for internal buses (G-BUS). Therefore, the external bus master cannot access the internal memories or the internal I/O. The arbitration of bus control authority for external buses is executed by the external bus interface circuit (EBIF), and this is independent of the CPU and the internal DMAC. Even when the external bus master holds the external bus control authority, the CPU and the internal DMAC can access the internal ROM, RAM and registers. On the other hand, if the CPU or the internal DMAC tries to access an external memory when the external bus master holds the external bus control authority, the CPU or the internal DMAC has to wait until the external bus master releases the bus. For this reason, if the BUSRQ remains active, the TMP19A43 can lock.
(2) Acquisition of bus control authority The external bus master requests the TMP19A43 for bus control authority by asserting the BUSRQ signal. The TMP19A43 samples the BUSRQ signal at the break of external bus cycles on the internal buses (GBUS) and determines whether or not to give the bus control authority to the external bus master. When it gives the bus control authority to the external bus master, it asserts the BUSAK signal. At the same time, it makes address buses, data buses and bus control signals ( RD and WR ) in a state of high impedance. (The internal pull-up is enabled for the R/ W , HWR and CSx .) Depending on the relationship between the size of data to be loaded or stored and the external memory bus width, two or more bus cycles can occur in response to a single data transfer (bus sizing). In this case, the end of the last bus cycle is the break of external bus cycles. If access to external areas occurs consecutively on the TMP19A43, a dummy cycle can be inserted. Again, requests for buses are accepted at the break of external bus cycles on the internal buses (G-BUS). During a dummy cycle, the next external bus cycle is already started on the internal buses. Therefore, even if the BUSRQ signal is asserted during a dummy cycle, the bus is not released until the next external bus cycle is completed. Keep asserting the BUSRQ signal until the bus control authority is released. Fig. 8-19 shows the timing of acquiring bus control authority by the external bus master.
TMP19A43 (rev2.0) 8-24
External Bus Interface
TMP19A43
tsys Internal address External address BUSRQ BUSAK
TMP19A43 external access
TMP19A43 external access
TMP19A43 external access
External bus master cycle
TMP19A43 external access
BUSRQ is at the "H" level. The TMP19A43 recognizes that the BUSRQ is at the "L" level, and releases the bus at the end of the bus cycle. When the bus is completed, the TMP19A43 asserts BUSAK . The external bus master recognizes that the
BUSAK is at the "L" level, and acquires the bus control authority to start bus operations.
Fig. 8-19 Bus Control Authority Acquisition Timing
(3) Release of bus control authority The external bus master releases the bus control authority when it becomes unnecessary. If the external bus master no longer needs the bus control authority that it has held, it deasserts the BUSRQ signal and returns the bus control authority to the TMP19A43. Fig. 8-20 shows the timing of releasing unnecessary bus control authority.
tsys
Internal address External address BUSRQ BUSAK
TMP19A43 external access
TMP19A43 external access
TMP19A43 external access
External bus master cycle
TMP19A43 external access
The external bus master has the bus control authority. The external bus master deasserts the BUSRQ , as it no longer requires the bus control authority. The TMP19A43 recognizes that the BUSRQ is at the "H" level, and deasserts the BUSAK .
Fig. 8-20 Timing of Releasing Bus Control Authority
TMP19A43 (rev2.0) 8-25
External Bus Interface
TMP19A43
9.
The Chip Selector and Wait Controller
The TMP19A43 can be connected to external devices (I/O devices, ROM and SRAM). 4-block address spaces (CS0 through CS3) can be established in the TMP19A43 and three parameters can be specified for each 4-block address and other address spaces: data bus width, the number of waits and the number of dummy cycles.
CS0 through CS3 (also used as P40 through P43) are the output pins corresponding to spaces CS0 through CS3. These pins generate chip selector signals (for ROM and SRAM) to each space when the CPU designates an address in which spaces CS0 through CS3 are selected. For chip selector signals to be generated, however, the port 4 controller register (P4CR) and the port 4 function register (P4FC) must be set appropriately. The specification of the spaces CS0 through CS3 is to be performed with a combination of base addresses (BAn, n=0 to 3) and mask addresses (MAn, n=0 to 3) using the base and mask address setting registers (BMA0 through BMA3). Meanwhile, master enable, data bus width, the number of waits and the number of dummy cycles for each address space are specified in the chip selector and wait controller registers (B01CS, B23CS, and BEXCS).
A bus wait request pin ( WAIT /RDY) is provided as an input pin to control the status of these settings.
9.1 Specifying Address Spaces
Spaces CS0 through CS3 are specified using the base and mask address setting registers (BMA0 through BMA3). In each bus cycle, a comparison is made to see if each address on the bus is located in the space CS0 through CS3. If the result of a comparison is a match, it is considered that the designated CS space has been accessed and chip selector signals are output from pins CS0 through CS3 and the operations specified by the chip selector and wait controller registers (B01CS and B23CS) are executed. (Refer to "9.2 The Chip Selector and Wait Controller.")
9.1.1 Base and Mask Address Setting Registers
Fig. 9-1 and Fig. 9-2 show base and mask address setting registers. For base addresses (BA0 through BA3), a start address in the space CS0 through CS3 is specified. In each bus cycle, the chip selector and wait controller compare values in their registers with addresses and those addresses with address bits masked by the mask address (MA0 through MA3) are not compared. The size of an address space is determined by the mask address setting. (1) Base addresses Base address BAn specifies the higher-order 16 bits (A31 through A16) of the start address. The lowerorder 16 bits (A15 to A0) of the start address are always set to "0." Therefore, the start address begins with 0x0000_0000H and increases in 64 kilobyte units. Fig. 9-3 shows the relationship between the start address and the BAn value. (2) Mask addresses Mask address (MAn) specifies which address bit value is to be compared. The address on the bus that corresponds to the bit for which "0" is written on the address mask MAn is to be included in address comparison to determine if the address is in the area of the CS0 to CS3 spaces. The bit for which "1" is written is not included in address comparison. CS0 to CS3 spaces have different address bits that can be masked by MA0 to MA3. CS0 space and CS1 space: A29 through A14 CS2 space and CS3 space: A30 through A15 (Note) Address settings must be made using physical addresses.
TMP19A43 (rev2.0) 9-1 The Chip Selector and Wait Controller
TMP19A43
Base and mask address setting registers BMA0 (0xFFFF_E400) to BMA3 (0xFFFF_E40C)
7 BMA0 (0xFFFF_E400) Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function 6 5 4 MA0 R/W 1 15 1 1 1 1 1 1 CS0 space size setting 0: Address for comparison 14 13 12 11 10 9 8 MA0 R/W 0 0 0 0 0 1 1 Make sure that you write "0." CS0 space size setting 0: Address for comparison 22 21 20 19 18 17 16 BA0 R/W 0 0 0 0 0 0 0 A23 to A16 to be set as a start address 30 29 28 27 26 25 24 BA0 R/W 0 0 0 0 0 0 0 A31 to A24 to be set as a start address 6 5 4 MA1 R/W 1 15 Bit symbol Read/Write After reset Function 1 1 1 1 1 1 CS1 space size setting 0: Address for comparison 14 13 12 11 10 9 8 MA1 R/W 0 0 0 0 0 1 1 Make sure that you write "0." CS1 space size setting 0: Address for comparison 22 21 20 19 18 17 16 BA1 R/W 0 0 0 0 0 0 0 A23 to A16 to be set as a start address 30 29 28 27 26 25 24 BA1 R/W 0 0 0 0 0 0 0 A31 to A24 to be set as a start address 1 3 2 1 0 1 3 2 1 0
0
23 Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function
0 31
0
7 BMA1 (0xFFFF_E404) Bit symbol Read/Write After reset Function
0
23 Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function
0 31
0
(Note)
Make sure that you write "0" for bits 10 through 15 for BMA0 and BMA1. The size of both the CS0 and CS1 spaces can be a minimum of 16 KB to a maximum of 1 GB. The external address space of the TMP19A43 is 16 MB and so bits 10 through 15 must be set to "0" as addresses A24 through A29 are not masked. Fig. 9-1 Base and Mask Address Setting Registers (BMA0, BMA1)
TMP19A43 (rev2.0) 9-2 The Chip Selector and Wait Controller
TMP19A43
7 BMA2 (0xFFFF_E408) Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function
6
5
4 MA2 R/W
3
2
1
0
1 15
1 14
0 23
0 22
0 31
0 30
0
0
1 1 1 1 CS0 space size setting 0: Address for comparison 13 12 11 10 MA2 R/W 0 0 0 0 Make sure that you write "0." 21 20 19 18 BA2 R/W 0 0 0 0 A23 to A16 to be set as a start address 29 28 27 26 BA2 R/W 0 0 0 0 A31 to A24 to be set as a start address 5 4 MA3 R/W 3 2
1 9
1 8
1 17
1 16
0 25
0 24
0
0
7 BMA3 (0xFFFF_E40C) Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function Bit symbol Read/Write After reset Function
6
1
0
1 15
1 14
0 23
0 22
0 31
0 30
0
0
1 1 1 1 CS1 space size setting 0: Address for comparison 13 12 11 10 MA3 R/W 0 0 0 0 Make sure that you write "0." 21 20 19 18 BA3 R/W 0 0 0 0 A23 to A16 to be set as a start address 29 28 27 26 BA3 R/W 0 0 0 0 A31 to A24 to be set as a start address
1 9
1 8
1 17
1 16
0 25
0 24
0
0
(Note)
Make sure that you write "0" for bits 9 through 15 for BMA2 and BMA3. The size of both the CS2 and CS3 spaces can be a minimum of 32 KB to a maximum of 2 GB. The external address space of the TMP19A43 is 16 MB and so bits 9 through 15 must be set to "0" as addresses A24 through A30 are not masked. Fig. 9-2 Base and Mask Address Setting Registers (BMA2, BMA3)
TMP19A43 (rev2.0) 9-3 The Chip Selector and Wait Controller
TMP19A43
Address
0xFFFF_FFFF Start address Base address value (BAn) FFFFH
0xFFFF_0000
0x0006_0000
0006H
0x0005_0000
0005H
0x0004_0000
0004H
0x0003_0000
0003H
0x0002_0000
0002H
0x0001_0000
0x0000_0000
0001H
64 KB
0x0000_0000
0000H
Fig. 9-3 Start and Base Address Register Values
9.1.2 How to Define Start Addresses and Address Spaces
* To specify a space of 64 KB starting at 0xC000_0000 in the CS0 space, the base and mask address registers must be programmed as shown below.
31 BA0
16 15 MA0
0
11000000000000000000000000000011
C 0 0 0 0 0 0 3
Values to be set in the base and mask address registers (BMA0)
In the base address (BA0), specify "0xC000" that corresponds to higher 16 bits of a start address, while in the mask address (MA0), specify whether a comparison of addresses in the space A29 through A14 is to be made or not. A comparison of A31 and A30 will definitely be made and to ensure a comparison of A29 through A24, set bits 15 to 10 of the mask address (MA0) to "0." This setting allows A31 through A16 to be compared with the value specified as a start address. Therefore, a space of 64 KB from 0xC000_0000 to 0xC000_FFFF is designated as a CS0 space and the
CS0 signal is asserted if there is a match with an address on the bus.
TMP19A43 (rev2.0) 9-4 The Chip Selector and Wait Controller
TMP19A43
To specify a space of 1 MB starting at 0x1FD0_0000 in the CS2 space, the base and mask address registers must be programmed as shown below.
31 BA2
16 15 MA2
0
00011111110100000000000000011111 1 F D 0 0 0 1 F
Values to be set in the base and mask address registers (BMA2)
In the base address (BA2), specify "0x1FD0" that corresponds to higher 16 bits of a start address, while in the mask address (MA2), specify whether a comparison of addresses in the space A30 through A15 is to be made or not. A comparison of A31 will definitely be made and to ensure a comparison of A30 through A20, set bits 15 to 5 of the mask address (MA2) to "0." This setting allows A31 through A20 to be compared with the value specified as a start address. As A19 through A0 are masked, a space of 1 MB from 0x1FD0_0000 to 0x1FDF_FFFF is designated as a CS2 space. After a reset, the CS0, CS1 and CS3 spaces are disabled, while the whole CS2 space (4 GB) is enabled as an address space.
TMP19A43 (rev2.0) 9-5 The Chip Selector and Wait Controller
TMP19A43
Table 9-1 shows the relationship between CS space and space sizes. If two or more address spaces are specified simultaneously, a space or spaces with a smaller space number will be given priority in space selection. Example: 0xC000_0000 as a start address of the CS0 space with a space size of 16 KB 0xC000_0000 as a start address of the CS1 space with a space size of 64 KB
CS0 space
CS1 space 0xC000_FFFF
0xC000_3F 0xC000_00
0xC000_3F 0xC000_00
If a space of 0xC000_0000 to 0xC000_3FFF is accessed, the CS0 space is selected.
Table 9-1 CS Space and Space Sizes
Size (bytes) CS space CS0 CS1 CS2 CS3 16 K 32 K 64 K 128 K 256 K 512 K 1M 2M 4M 8M 16 M
TMP19A43 (rev2.0) 9-6 The Chip Selector and Wait Controller
TMP19A43
9.2 The Chip Selector and Wait Controller
Fig. 9-4 to Fig. 9-6 show the chip selector and wait controller registers. For each address space (spaces CS0 through CS3 and other address spaces), each chip selector and wait controller register (B01CS through B23CS, BEXCS) can be programmed to set master enable or disable, to select data bus width, to specify the number of waits and to insert dummy cycles. If two or more address spaces are specified simultaneously, a space or spaces with a smaller space number will be given priority in space selection (order of priority: CS0>CS1>CS2>CS3>EXCS).
B01CS (0xFFFF_E480), B23CS (0xFFFF_E484), BEXCS (0xFFFF_E488)
B01CS (0xFFFF_E480) 7 Bit symbol Read/Write After reset Function B0OM R/W 6 5 4 B0BUS 3 2 B0W R/W 0 1 0 1 Specify the number of waits. (automatic WAIT insertion) 0000: 0WAIT 0001: 1WAIT 0010: 2WAIT 0011: 3WAIT 0100: 4WAIT 0101: 5WAIT 0110: 6WAIT 0111: 7WAIT (external WAIT input) 1010: (2+2xN) WAIT 1011: (3+2xN) WAIT 1100: (4+2xN) WAIT 1101: (5+2xN) WAIT 1110: (6+2xN) WAIT 1111: (7+2xN) WAIT 1000, 1001: reserved 11 10 9 8 B0E B0RCV R/W R R/W 0 0 0 Enable or This can be Specify the number of disable read as "0." dummy cycles to be CS0. inserted. 0: Disable (read, recovery time) 1: Enable 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited 1 0
R 0 0 0 0 Select the chip selector This can Select data output waveform. be read as bus width. 00: ROM/RAM "0." 0: 16 bit Do not make any other 1: 8 bit settings.
Bit symbol Read/Write After reset Function
Bit symbol Read/Write After reset Function
14 B0CSCV R R/W 0 0 This can Specify the be read as number of "0." dummy cycles to be inserted. (CS0 recovery time) 1: 1 cycle 0: None 23 22 B1OM R/W 0 0 Select the chip selector output waveform. 00: ROM/RAM Do not make any other settings.
15
13 B0WCV R/W
12
0 0 Specify the number of dummy cycles to be inserted. (write, recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited
21
20 B1BUS
19
18 B1W
17
16
R 0 0 This can Select data be read as bus width. "0." 0: 16 bit 1: 8 bit
R/W 0 1 0 1 Specify the number of waits. (automatic WAIT insertion) 0000: 0WAIT 0001: 1WAIT 0010: 2WAIT 0011: 3WAIT 0100: 4WAIT 0101: 5WAIT 0110: 6WAIT 0111: 7WAIT
(external WAIT input)
Bit symbol Read/Write After reset Function
30 B1CSCV R R/W 0 0 This can Specify the be read as number of "0." dummy cycles to be inserted. (CS1 recovery time) 1: 1 cycle 0: None
31
29 B1WCV R/W
28
0 0 Specify the number of dummy cycles to be inserted. (write, recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited
1010: (2+2xN) WAIT 1011: (3+2xN) WAIT 1100: (4+2xN) WAIT 1101: (5+2xN) WAIT 1110: (6+2xN) WAIT 1111: (7+2xN) WAIT 1000, 1001: reserved 27 26 25 24 B1E B1RCV R/W R R/W 0 0 0 0 Enable or This can be Specify the number of disable read as "0." dummy cycles to be CS1. inserted. 0: Disable (read, recovery time) 1: Enable 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited
Fig. 9-4 Chip Selector and Wait Controller Registers
TMP19A43 (rev2.0) 9-7 The Chip Selector and Wait Controller
TMP19A43
B23CS (0xFFFF_E484)
7 Bit symbol Read/Write After reset Function B2OM R/W
6
5
4 B2BUS
3
2 B2W
1
0
0 0 0 Select the chip selector This can Select data output waveform. be read as bus width. 00: ROM/RAM 0: 16 bit "0." Do not make any other 1: 8 bit settings.
Bit symbol Read/Write After reset Function
Bit symbol Read/Write After reset Function
14 B2CSCV R R/W 0 0 This can Specify the be read as number of "0." dummy cycles to be inserted. (CS2 recovery time) 1: 1 cycle 0: None 23 22 B3OM R/W 0 0 Select the chip select output waveform. 00: ROM/RAM Do not make any other settings.
15
13 B2WCV R/W
12
0 0 Specify the number of dummy cycles to be inserted. (write, recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited
R/W 0 1 0 1 Specify the number of waits. (automatic WAIT insertion) 0000: 0WAIT 0001: 1WAIT 0010: 2WAIT 0011: 3WAIT 0100: 4WAIT 0101: 5WAIT 0110: 6WAIT 0111: 7WAIT (external WAIT input) 1010: (2+2xN) WAIT 1011: (3+2xN) WAIT 1100: (4+2xN) WAIT 1101: (5+2xN) WAIT 1110: (6+2xN) WAIT 1111: (7+2xN) WAIT 1000, 1001: reserved 11 10 9 8 B2E B2M B2RCV R/W 1 0 0 0 Enable or Select CS2 Specify the number of disable space. dummy cycles to be CS2. 0: 4 GB inserted. 0: Disable space (read, recovery time) 1: Enable 1: CS 00: 2 cycles space 01: 1 cycle 10: None 11: Setting prohibited
21
20 B3BUS
19
18 B3W
17
16
R 0 0 This can Select data be read as bus width. "0." 0: 16 bit 1: 8 bit
Bit symbol Read/Write After reset Function
30 B3CSCV R R/W 0 0 This can Specify the be read as number of "0." dummy cycles to be inserted. (CS3 recovery time) 1: 1 cycle 0: None
31
29 B3WCV R/W
28
0 0 Specify the number of dummy cycles to be inserted. (write, recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited
R/W 0 1 0 1 Specify the number of waits. (automatic WAIT insertion) 0000: 0WAIT 0001: 1WAIT 0010: 2WAIT 0011: 3WAIT 0100: 4WAIT 0101: 5WAIT 0110: 6WAIT 0111: 7WAIT (external WAIT input) 1010: (2+2xN) WAIT 1011: (3+2xN) WAIT 1100: (4+2xN) WAIT 1101: (5+2xN) WAIT 1110: (6+2xN) WAIT 1111: (7+2xN) WAIT 1000, 1001: reserved 27 26 25 24 B3E B3RCV R/W R R/W 0 0 0 0 Enable or This can Specify the number of disable be read as dummy cycles to be CS3. "0." inserted. 0: Disable (read, recovery time) 1: Enable 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited
Fig. 9-5 Chip Selector and Wait Controller Registers
TMP19A43 (rev2.0) 9-8 The Chip Selector and Wait Controller
TMP19A43
BEXCS Little (0xFFFF_E48C) Bit symbol Big (0xFFF,F_E48E) Read/Write After reset Function
7 BEXOM R/W
6
5
4 BEXBUS 0 Select data bus width. 0: 16 bit 1: 8 bit
3
2 BEXW
1
0
R 0 0 0 Select the chip selector This can output waveform. be read as 00: ROM/RAM "0." Do not make any other settings.
Bit symbol Read/Write After reset Function
14 BECSCV R R/W 0 0 This can Specify the be read as number of "0." dummy cycles to be inserted. 1: 1 cycle 0: None
15
13 BEXWCV R/W
12
0 0 Specify the number of dummy cycles to be inserted. (write, recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited
R/W 0 1 0 1 Specify the number of waits. (automatic WAIT insertion) 0000: 0WAIT 0001: 1WAIT 0010: 2WAIT 0011: 3WAIT 0100: 4WAIT 0101: 5WAIT 0110: 6WAIT 0111: 7WAIT (external WAIT input) 1010: (2+2xN) WAIT 1011: (3+2xN) WAIT 1100: (4+2xN) WAIT 1101: (5+2xN) WAIT 1110: (6+2xN) WAIT 1111: (7+2xN) WAIT 1000, 1001: reserved 11 10 9 8 BEXRCV R R/W 0 0 0 This can be read as "0." Specify the number of dummy cycles to be inserted. (read, recovery time) 00: 2 cycles 01: 1 cycle 10: None 11: Setting prohibited
Fig. 9-6 Chip Selector and Wait Controller Registers
A reset of the TMP19A43 allows the port 4 controller register (P4CR) and the port 4 function register (P4FC) to be cleared to "0," and the CS signal output is disabled. To output the CS signals, set the corresponding bits to "1" at the P4FC and the P4CR in that order. The CS recovery time can be configured in any other areas than the CS setting areas, but CS signals will not be output.
TMP19A43 (rev2.0) 9-9 The Chip Selector and Wait Controller
TMP19A43
10. DMA Controller (DMAC)
The TMP19A43 has a built-in 8-channel DMA Controller (DMAC).
10.1 Features
The DMAC of the TMP19A43 has the following features: (1) DMA with 8 independent channels (two interrupt factors, 0ch through 3ch: INTDMA0, 4ch through 7ch: INTDMA1) (2) Two types of requests for bus control authority: With and without snoop requests (3) Transfer requests: Internal requests (software initiated)/external requests (external interrupts, interrupt requests given by internal peripheral I/Os, and requests given by the DREQ pin) Requests given by the DREQ pin (CH0, 4): Level mode (memory memory) Edge mode (memory I/O, I/O to memory) (4) Transfer mode: Dual address mode (5) Transfer devices: Memory space transfer (6) Device size: 32-bit memory (8 or 16 bits can be specified using the CS/WAIT controller); I/O of 8, 16 or 32 bits (7) Address changes: Increase, decrease, fixed, irregular increase, irregular decrease (8) Channel priority: Fixed (in ascending order of channel numbers) (9) Endian switchover function
TMP19A43 (rev2.0) 10-1
DMA Controller (DMAC)
TMP19A43
10.2 Configuration
10.2.1 Internal Connections of the TMP19A43
Fig. 10-1 shows the internal connections with the DMAC in the TMP19A43.
DREQ [4,0] DACK [4,0]
Port function control DACK [7 : 0]* Interrupt controller External interrupt request Internal I/O interrupt request
TX19A processor core
INTDREQ [7 : 0]*
(external request)
Notification to release bus control authority
DMAC
BUSGNT
*
Request for bus control authority Request to release bus control authority Notification of bus control authority ownership Control Address Data
BUSREQ *
BUSREL *
HAVEIT *
(Note)
In Fig. 10.1, signals indicated by * are internal signals. Fig. 10-1 DMAC Connections in the TMP19A43 The DMAC has eight DMA channels. Each of these channels handles the data transfer request signal (INTDREOn) from the interrupt controller and the acknowledgment signal (DACKn) generated in response to INTDREOn, where "n" is a channel number from 0 to 7. External pins (DREQ0 and DREQ4) are internally wired to allow them to function as pins of the port F. To use them as pins of the port F, they must be selected by setting the function control register PFFC to an appropriate setting. Pins, DACK0 and DACK4, handle the data transfer request and acknowledge signal output supplied through external pins, DREQ0 and DREQ4. Channel 0 is given higher priority than channel 1, channel 1 higher priority than channel 2 and channel 2 higher priority than channel 3. Subsequent channels are given priority in the same manner. The TX19A processor core has a snoop function. Using the snoop function, the TX19A processor core opens the core's data bus to the DMAC, thus allowing the DMAC to access the internal ROM and RAM linked to the core. The DMAC is capable of determining whether or not to use this snoop function. For further information on the snoop function, refer to 10.2.3 "Snoop Function." Two types of bus control authority (SREQ and GREQ) are available to the DMAC and which type of control right to use depends on the use or nonuse of the snoop function. GREQ is a request for bus control authority if the DMAC does not use the snoop function, while SREQ is a request for bus control authority if the DMAC uses the snoop function. SREQ is given higher priority than GREQ.
TMP19A43 (rev2.0) 10-2
DMA Controller (DMAC)
TMP19A43
10.2.2
DMAC Internal Blocks
Fig. 10-2 shows the internal blocks of the DMAC.
Channel 7 Channel 6 Channel 5 Channel 4 Channel 3 Channel 2 Channel 1 Channel 0 31 Source address registerSARx Destination address registerDARx Byte count registerBSRx Channel control registerCCRx Channel status registerCSRx DMA transfer control registerDTCRx x0 through 7 DMA control registerDCR Request select registerRSR Data holding registerDHR 0
Fig. 10-2 DMAC Internal Blocks
10.2.3
Snoop Function
The TX19A processor core has a snoop function. If the snoop function is activated, the TX19A processor core opens the core's data bus to the DMAC and suspends its own operation until the DMAC withdraws a request for bus control authority. If the snoop function is enabled, the DMAC can access the internal RAM and ROM and therefore designate the RAM or ROM as a source or destination. If the snoop function is not used, the DMAC cannot access the internal RAM or ROM. However, the GBus is opened to the DMAC. If the TX19A processor core attempts to access memory or the I/O by way of the G-Bus and if the DMAC does not accept a bus control release request, bus operations cannot be executed and, as a result, the pipeline stalls. (Note) If the snoop function is not used, the TX19A processor core does not open the data bus to the DMAC. If the data bus is closed and the internal RAM or ROM is designated as a DMAC source or destination, an acknowledgment signal will not be returned in response to a DMAC transfer bus cycle and, as a result, the bus will lock.
TMP19A43 (rev2.0) 10-3
DMA Controller (DMAC)
TMP19A43
10.3 Registers
The DMAC has fifty-one 32-bit registers. Table 10.1 shows the register map of the DMAC. Table 10.1 DMAC Registers
Address 0xFFFF_E200 0xFFFF_E204 0xFFFF_E208 0xFFFF_E20C 0xFFFF_E210 0xFFFF_E218 0xFFFF_E220 0xFFFF_E224 0xFFFF_E228 0xFFFF_E22C 0xFFFF_E230 0xFFFF_E238 0xFFFF_E240 0xFFFF_E244 0xFFFF_E248 0xFFFF_E24C 0xFFFF_E250 0xFFFF_E258 0xFFFF_E260 0xFFFF_E264 0xFFFF_E268 0xFFFF_E26C 0xFFFF_E270 0xFFFF_E278 0xFFFF_E280 0xFFFF_E284 0xFFFF_E288 0xFFFF_E28C 0xFFFF_E290 0xFFFF_E298 0xFFFF_E2A0 0xFFFF_E2A4 0xFFFF_E2A8 0xFFFF_E2AC 0xFFFF_E2B0 0xFFFF_E2B8 0xFFFF_E2C0 0xFFFF_E2C4 0xFFFF_E2C8 0xFFFF_E2CC 0xFFFF_E2D0 0xFFFF_E2D8 Register symbol CCR0 CSR0 SAR0 DAR0 BCR0 DTCR0 CCR1 CSR1 SAR1 DAR1 BCR1 DTCR1 CCR2 CSR2 SAR2 DAR2 BCR2 DTCR2 CCR3 CSR3 SAR3 DAR3 BCR3 DTCR3 CCR4 CSR4 SAR4 DAR4 BCR4 DTCR4 CCR5 CSR5 SAR5 DAR5 BCR5 DTCR5 CCR6 CSR6 SAR6 DAR6 BCR6 DTCR6 Register name Channel control register (ch. 0) Channel status register (ch. 0) Source address register (ch. 0) Destination address register (ch. 0) Byte count register (ch. 0) DMA transfer control register (ch. 0) Channel control register (ch. 1) Channel status register (ch. 1) Source address register (ch. 1) Destination address register (ch. 1) Byte count register (ch. 1) DMA transfer control register (ch. 1) Channel control register (ch. 2) Channel status register (ch. 2) Source address register (ch. 2) Destination address register (ch. 2) Byte count register (ch. 2) DMA transfer control register (ch. 2) Channel control register (ch. 3) Channel status register (ch. 3) Source address register (ch. 3) Destination address register (ch. 3) Byte count register (ch. 3) DMA transfer control register (ch. 3) Channel control register (ch. 4) Channel status register (ch. 4) Source address register (ch. 4) Destination address register (ch. 4) Byte count register (ch. 4) DMA transfer control register (ch. 4) Channel control register (ch. 5) Channel status register (ch. 5) Source address register (ch. 5) Destination address register (ch. 5) Byte count register (ch. 5) DMA transfer control register (ch. 5) Channel control register (ch. 6) Channel status register (ch. 6) Source address register (ch. 6) Destination address register (ch. 6) Byte count register (ch. 6) DMA transfer control register (ch. 6)
TMP19A43 (rev2.0) 10-4
DMA Controller (DMAC)
TMP19A43
Table 10.2 DMAC Registers (continued)
0xFFFF_E2E0 0xFFFF_E2E4 0xFFFF_E2E8 0xFFFF_E2EC 0xFFFF_E2F0 0xFFFF_E2F8 0xFFFF_E300 0xFFFF_E304 0xFFFF_E30C CCR7 CSR7 SAR7 DAR7 BCR7 DTCR7 DCR RSR DHR Channel control register (ch. 7) Channel status register (ch. 7) Source address register (ch. 7) Destination address register (ch. 7) Byte count register (ch. 7) DMA transfer control register (ch. 7) DMA control register (DMAC) Request select register (DMAC) Data holding register (DMAC)
TMP19A43 (rev2.0) 10-5
DMA Controller (DMAC)
TMP19A43
10.3.1
DCR (0xFFFF_E300H)
DMA Control Register (DCR)
7 6 Rst6 5 Rst5 4 Rst4 W 0 See detailed description. 15 14 13 12 W 0 23 22 21 20 W 0 31 30 29 28 W 0
See detailed description.
3 Rst3
2 Rst2
1 Rst1
0 Rst0
bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function
Rst7
11
10
9
8
19
18
17
16
bit Symbol Read/Write After reset Function 27 26 25 24 bit Symbol Read/Write After reset Function Rstall
Bit 31
Mnemonic Rstall
Field name Reset all
Description Performs a software reset of the DMAC. If the Rstall bit is set to 1, the values of all the internal registers of the DMAC are reset to their initial values. All transfer requests are canceled and all eight channels go into an idle state. 0: Don't care 1: Initializes the DMAC Performs a software reset of the DMAC channel 7. If the Rst7 bit is set to 1, internal registers of the DMAC channel 7 and a corresponding bit of the channel 7 of the RSR register are reset to their initial values. The transfer request of the channel 7 is canceled and the channel 7 goes into an idle state. 0: Don't care 1: Initializes the DMAC channel 7 Performs a software reset of the DMAC channel 6. If the Rst6 bit is set to 1, internal registers of the DMAC channel 6 and a corresponding bit of the channel 6 of the RSR register are reset to their initial values. The transfer request of the channel 6 is canceled and the channel 6 goes into an idle state. 0: Don't care 1: Initializes the DMAC channel 6 Performs a software reset of the DMAC channel 5. If the Rst5 bit is set to 1, internal registers of the DMAC channel 5 and a corresponding bit of the channel 5 of the RSR register are reset to their initial values. The transfer request of the channel 5 is canceled and the channel 5 goes into an idle state. 0: Don't care 1: Initializes the DMAC channel 5
7
Rst7
Reset 7
6
Rst6
Reset 6
5
Rst5
Reset 5
TMP19A43 (rev2.0) 10-6
DMA Controller (DMAC)
TMP19A43
Bit 4
Mnemonic Rst4
Field name Reset 4
Description Performs a software reset of the DMAC channel 4. If the Rst4 bit is set to 1, internal registers of the DMAC channel 4 and a corresponding bit of the channel 4 of the RSR register are reset to their initial values. The transfer request of the channel 4 is canceled and the channel 4 goes into an idle state. 0: Don't care 1: Initializes the DMAC channel 4 Performs a software reset of the DMAC channel 3. If the Rst3 bit is set to 1, internal registers of the DMAC channel 3 and a corresponding bit of the channel 3 of the RSR register are reset to their initial values. The transfer request of the channel 3 is canceled and the channel 3 goes into an idle state. 0: Don't care 1: Initializes the DMAC channel 3 Performs a software reset of the DMAC channel 2. If the Rst2 bit is set to 1, internal registers of the DMAC channel 2 and a corresponding bit of the channel 2 of the RSR register are reset to their initial values. The transfer request of the channel 2 is canceled and the channel 2 goes into an idle state. 0: Don't care 1: Initializes the DMAC channel 2 Performs a software reset of the DMAC channel 1. If the Rst1 bit is set to 1, internal registers of the DMAC channel 1 and a corresponding bit of the channel 1 of the RSR register are reset to their initial values. The transfer request of the channel 1 is canceled and the channel 1 goes into an idle state. 0: Don't care 1: Initializes the DMAC channel 1 Performs a software reset of the DMAC channel 0. If the Rst0 bit is set to 1, internal registers of the DMAC channel 0 and a corresponding bit of the channel 0 of the RSR register are reset to their initial values. The transfer request of the channel 0 is canceled and the channel 0 goes into an idle state. 0: Don't care 1: Initializes the DMAC channel 0
3
Rst3
Reset 3
2
Rst2
Reset 2
1
Rst1
Reset 1
0
Rst0
Reset 0
Fig. 10-3 DMA Control Register (DCR) (Note 1) If a write to the DCR register occurs during a software reset right after the last round of DMA transfer is completed, the interrupt to stop DMA transfer is not canceled although the channel register is initialized. (Note 2) An attempt to execute a write (software reset) to the DCR register by DMA transfer must be strictly avoided.
TMP19A43 (rev2.0) 10-7
DMA Controller (DMAC)
TMP19A43
10.3.2
Channel Control Registers (CCRn)
7 6 DIO R/W 5 DAC R/W 0 See Always set detailed this bit to "0". description . 15 bit Symbol Read/Write Function R/W Always set this bit to "0." 23 bit Symbol Read/Write After reset Function See detailed description. 31 bit Symbol Read/Write After reset Function
See detailed description.
4
3 TrSiz R/W
2
1 DPS R/W
0
CCRn (0xFFFF_E200H) (0xFFFF_E220H) (0xFFFF_E240H)
bit Symbol Read/Write After reset Function
SAC R/W
See detailed description
(0xFFFF_E260H) (0xFFFF_E280H) (0xFFFF_E2A0H) (0xFFFF_E2E0H)
14 ExR R/W
13 PosE R/W
12 Lev R/W 0
11 SReq R/W
10 RelEn R/W
9 SIO R/W
8 SAC R/W
(0xFFFF_E2C0H) After reset
See detailed description.
22 AblEn R/W 1
21 R/W
20 R/W
19 R/W 0
18 R/W
17 Big R/W 1
16 R/W 0
NIEn R/W
Always set this bit to "0."
See detailed Always description. set this bit to "0."
30
29
28
27
26
25
24 W
Str W 0
Always set this bit to "0."
Fig. 10-4
TMP19A43 (rev2.0) 10-8
DMA Controller (DMAC)
TMP19A43
Bit 31
Mnemonic Str
Field name Channel start
Description Start (initial value:-) Starts channel operation. If this bit is set to 1, the channel goes into a standby mode and starts to transfer data in response to a transfer request. Only a write of 1 is valid to the Str bit and a write of 0 is ignored. A read always returns a 0. 1: Starts channel operation This is a reserved bit. Always set this bit to "0." Normal Completion Interrupt Enable (initial value: 1) 1: Normal completion interrupt enable 0: Normal completion interrupt disable Abnormal Completion Interrupt Enable (initial value: 1) 1: Abnormal completion interrupt enable 0: Abnormal completion interrupt disable This is a reserved bit. Although its initial value is "1," always set this bit to "0." This is a reserved bit. Always set this bit to "0." This is a reserved bit. Always set this bit to "0." This is a reserved bit. Always set this bit to "0." Big Endian (initial value: 1) 1: A channel operates by big-endian 0: A channel operates by little-endian This is a reserved bit. Always set this bit to "0." This is a reserved bit. Always set this bit to "0." External Request Mode (initial value: 0) Selects a transfer request mode. (only for 0ch and 4ch) 1: External transfer request (interrupt request or external DREQn request) 0: Internal transfer request (software initiated) Positive Edge (initial value: 0) The effective level of the transfer request signal INTDREQn or DREQn is specified. This function is valid only if the transfer request is an external transfer request (if the ExR bit is 1). If it is an internal transfer request (if the ExR bit is 0), the PosE value is ignored. Because the INTDREQn and DREQn signals are active at "L" level, make sure that this PosE bit is set to "0." 1: Setting prohibited 0: The falling edge of the INTDREQn or DREQn signal or the "L" level is effective. The DACKn is active at "L" level. Level Mode (initial value: 0) Specifies which is used to recognize the external transfer request, signal level or signal change. This setting is valid only if a transfer request is the external transfer request (if the ExR bit is 1). If the internal transfer request is specified as a transfer request (if the ExR bit is 0), the value of the Lev bit is ignored. Because the INTDREQn signal is active at "L" level, make sure that you set the Lev bit to "1." The state of active DREQn is determined by the Lev bit setting. 1: Level mode The level of the DREQn signal is recognized as a data transfer request. (The "L" level is recognized if the PosE bit is 0. 0: Edge mode A change in the DREQn signal is recognized as a data transfer request. (A falling edge is recognized if the PosE bit is 0.) Snoop Request (initial value: 0) The use of the snoop function is specified by asserting the bus control request mode. If the snoop function is used, the snoop function of the TX19A processor core is enabled and the DMAC can use the data bus of the TX19A processor core. If the snoop function is not used, the snoop function of the TX19A processor core does not work. 1: Use snoop function (SREQ) 0: Do not use snoop function (GREQ)
24 23
NIEn
(Reserved) Normal completion interrupt enable Abnormal completion interrupt enable (Reserved) (Reserved) (Reserved) (Reserved) Big-endian
22
AbIEn
21 20 19 18 17
Big
16 15 14
ExR
(Reserved) (Reserved) External request mode
13
PosE
Positive edge
12
Lev
Level mode
11
SReq
Snoop request
TMP19A43 (rev2.0) 10-9
DMA Controller (DMAC)
TMP19A43
Bit 10
Mnemonic RelEn
Field name Bus control release request enable
Description Release Request Enable (initial value: 0) Acknowledgment of the bus control release request made by the TX19A processor core is specified. This function is valid only if GREQ is generated. If SREQ is generated, the TX19A processor core cannot make a bus control release request and, therefore, this function cannot be used. 1: The bus control release request is acknowledged if the DMAC has control of the bus. If the TX19A processor core issues a bus control release request, the DMAC relinquishes control of the bus to the TX19A processor core during a pause in bus operation. 0: The bus control release request is not acknowledged. Transfer type selection: (initial value: 0) 1 Single transfer 0: Continuous transfer (Data is transferred successively until BCRx becomes "0") Source Address Count (initial value: 00) Specifies the manner of change in a source address. 1x: Address fixed 01: Address decrease 00: Address increase This is a reserved bit. Always set this bit to "0". Destination Address Count (initial value: 00) Specifies the manner of change in a destination address. 1x: Address fixed 01: Address decrease 00: Address increase
9
SIO
Transfer type selection Source address count
8:7
SAC
6 5:4
DAC
(Reserved) Destination address count
Fig. 10-5 Channel Control Registers (CCRn) (2 of 3)
TMP19A43 (rev2.0) 10-10
DMA Controller (DMAC)
TMP19A43
Bit 3:2
Mnemonic TrSiz
Field name Transfer unit
Description Transfer Size (initial value: 00) Specifies the amount of data to be transferred in response to one transfer request. 11: 8 bits (1 byte) 10: 16 bits (2 bytes) 0x: 32 bits (4 bytes) *Make sure to set the same size as the device port size (DPS). Device Port Size (initial value: 00) Specifies the bus width of an I/O device designated as a source or destination device. 11: 8 bits (1 byte) 10: 16 bits (2 bytes) 0x: 32 bits (4 bytes) *Make sure to set the same size as the transfer unit (TrSiz)
1:0
DPS
Device port size
Fig. 10-6 Channel Control Registers (CCRn) (3 of 3) (Note 1) The CCRn register setting must be completed before the DMAC is put into a standby mode. (Note 2) When accessing the internal I/O or transferring data by DMA in response to the DREQ pin request, make sure that you set the transfer unit and the device port size to the same size. (Note 3) In executing memory-to-memory data transfer, a value set in DPS becomes invalid.
TMP19A43 (rev2.0) 10-11
DMA Controller (DMAC)
TMP19A43
10.3.3
RSR (0xFFFF_E304H)
Request Select Register (RSR)
7 6 5 4 ReqS4 R/W 0 Always set this bit to "0." See detailed description. 12 Always set this bit to "0." See detailed description. 8 3 2 1 0 ReqS0 R/W
bit Symbol Read/Write After reset Function
15 bit Symbol Read/Write After reset Function 23 bit Symbol Read/Write After reset Function 31 bit Symbol Read/Write After reset Function
14
13
11
10
9
0 22 21 20 19 18 17 16
0 30 29 28 27 26 25 24
0
Fig. 10-7
Bit 4 Mnemonic ReqS4 Field name Request select (ch.4) Description Request Select (initial value: 0) Selects a source of the external transfer request for the DMA channel 4. 1: Request made by DREQ4 0: Request made by the interrupt controller (INTC) Request Select (initial value: 0) Selects a source of the external transfer request for the DMA channel 0. 1: Request made by DREQ0 0: Request made by the interrupt controller (INTC)
0
ReqS0
Request select (ch.0)
(Note)
Make sure that you write "0" to bits 1 through 3 and 5 through 7 of the RSR register. Fig.10-8 DMA Control Register (RSR)
TMP19A43 (rev2.0) 10-12
DMA Controller (DMAC)
TMP19A43
10.3.4
Channel Status Registers (CSRn)
7 6 5 4 3 2 1 R/W 0 Always set this bit to "0." 15 bit Symbol Read/Write After reset Function 23 bit Symbol Read/Write After reset Function See detailed description. 31 bit Symbol Read/Write After reset Function
See detailed description.
0
CSRn (0xFFFF_E204H) (0xFFFF_E224H) (0xFFFF_E244H) (0xFFFF_E264H) (0xFFFF_E284H) (0xFFFF_E2A4H) (0xFFFF_E2C4H) (0xFFFF_E2E4H)
bit Symbol Read/Write After reset Function 14 13 12 11 10
9
8
0 22 AbC R/W R/W Always set this bit to "0." 30 29 21 20 BES R 0 See detailed description. 19 BED R 18 Conf R 17 16
NC R/W
28
27
26
25
24
Act R 0
Fig. 10-9 Channel Status Registers (CSRn)
TMP19A43 (rev2.0) 10-13
DMA Controller (DMAC)
TMP19A43
Bit 31
Mnemonic Act
Field name Channel active
Description Channel Active (initial value: 0) Indicates whether the channel is in a standby mode: 1: In a standby mode 0: Not in a standby mode Normal Completion (initial value: 0) Indicates normal completion of channel operation. If an interrupt at normal completion is permitted by the CCR register, the DMAC requests an interrupt when the NC bit becomes 1. This setting can be cleared by writing 0 to the NC bit. If a request for an interrupt at normal completion was previously issued, the request is canceled if the NC bit becomes 0. If an attempt is made to set the Str bit to 1 when the NC bit is 1, an error occurs. To start the next transfer, the NC bit must be cleared to 0. A write of 1 will be ignored. 1: Channel operation has been completed normally. 0: Channel operation has not been completed normally. Abnormal Completion (initial value: 0) Indicates abnormal completion of channel operation. If an interrupt at abnormal completion is permitted by the CCR register, the DMAC requests an interrupt when the AbC bit becomes 1. This setting can be cleared by writing 0 to the AbC bit. If a request for an interrupt at abnormal completion was previously issued, the request is canceled if the AbC bit becomes 0. Additionally, if the AbC bit is cleared to 0, each of the BES, BED and Conf bits are cleared to 0. If an attempt is made to set the Str bit to 1 when the AbC bit is 1, an error occurs. To start the next transfer, the AbC bit must be cleared to 0. A write of 1 will be ignored. 1: Channel operation has been completed abnormally. 0: Channel operation has not been completed abnormally. This is a reserved bit. Always set this bit to "0." Source Bus Error (initial value: 0) 1: A bus error has occurred when the source was accessed. 0: A bus error has not occurred when the source was accessed. Destination Bus Error (initial value: 0) 1: A bus error has occurred when the destination was accessed. 0: A bus error has not occurred when the destination was accessed. Configuration Error (initial value: 0) 1: A configuration error has occurred. 0: A configuration error has not occurred. These three bits are reserved bits. Always set them to "0."
23
NC
Normal completion
22
AbC
Abnormal completion
21 20
BES
(Reserved) Source bus error
19
BED
Destination bus error
18
Conf
Configuration error
2:0
(Reserved)
Fig. 10-10 Channel Status Registers (CSRn)
TMP19A43 (rev2.0) 10-14
DMA Controller (DMAC)
TMP19A43
10.3.5
Source Address Registers (SARn)
7 6 SAddr6 5 SAddr5 4 SAddr4 R/W Indeterminate See detailed description. 15 SAddr15 14 SAddr14 13 SAddr13 12 SAddr12 R/W Indeterminate See detailed description. 23 22 SAddr22 21 SAddr21 20 SAddr20 R/W Indeterminate See detailed description. 31 30 SAddr30 29 SAddr29 28 SAddr28 R/W Indeterminate See detailed description. 27 SAddr27 26 SAddr26 25 SAddr25 24 SAddr24 SAddr31 19 SAddr19 18 SAddr18 17 SAddr17 16 SAddr16 SAddr23 11 SAddr11 10 SAddr10 9 SAddr9 8 SAddr8 3 SAddr3 2 SAddr2 1 SAddr1 0 SAddr0
SARn
bit Symbol
SAddr7
(0xFFFF_E208H) Read/Write (0xFFFF_E228H) After reset (0xFFFF_E248H) Function (0xFFFF_E268H) (0xFFFF_E288H) bit Symbol (0xFFFF_E2A8H) Read/Write (0xFFFF_E2C8H) After reset (0xFFFF_E2E8H) Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function
Fig. 10-11
Bit 31 : 0 Mnemonic SAddr Field name Source address Description Source Address (initial value: -) Specifies the address of the source from which data is transferred using a physical address. This address changes according to the SAC and TrSiz settings of CCRn and the SACM setting of DTCRn.
Fig. 10-12 Source Address Register (SARn)
TMP19A43 (rev2.0) 10-15
DMA Controller (DMAC)
TMP19A43
10.3.6
Destination Address Register (DARn)
7 6 DAddr6 5 DAddr5 4 DAddr4 R/W Indeterminate See detailed description. 15 DAddr15 14 DAddr14 13 DAddr13 12 DAddr12 R/W Indeterminate See detailed description. 23 22 DAddr22 21 DAddr21 20 DAddr20 R/W Indeterminate See detailed description. 31 30 DAddr30 29 DAddr29 28 DAddr28 R/W Indeterminate See detailed description. 27 DAddr27 26 DAddr26 25 DAddr25 24 DAddr24 DAddr31 19 DAddr19 18 DAddr18 17 DAddr17 16 DAddr16 DAddr23 11 DAddr11 10 DAddr10 9 DAddr9 8 DAddr8 3 DAddr3 2 DAddr2 1 DAddr1 0 DAddr0
DARn
bit Symbol
DAddr7
(0xFFFF_E20CH) Read/Write (0xFFFF_E22CH) After reset (0xFFFF_E24CH) Function (0xFFFF_E26CH) (0xFFFF_E28CH) bit Symbol (0xFFFF_E2ACH) Read/Write (0xFFFF_E2CCH) After reset (0xFFFF_E2ECH) Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function
Fig. 10-13
Bit 31 : 0 Mnemonic DAddr Field name Destination address Description Destination Address (initial value: -) Specifies the address of the destination to which data is transferred using a physical address. This address changes according to the DAC and TrSiz settings of CCRn and the DACM setting of DTCRn.
Fig. 10-14 Destination Address Register (DARn)
TMP19A43 (rev2.0) 10-16
DMA Controller (DMAC)
TMP19A43
10.3.7
Byte Count Registers (BCRn)
7 6 BC6 5 BC5 4 BC4 R/W 0 See detailed description. 15 BC15 14 BC14 13 BC13 12 BC12 R/W 0 See detailed description. 23 22 BC22 21 BC21 20 BC20 R/W 0 See detailed description. 31 30 29 28 27 26 25 24 19 BC19 18 BC18 17 BC17 16 BC16 BC23 11 BC11 10 BC10 9 BC9 8 BC8 3 BC3 2 BC2 1 BC1 0 BC0
BCRn
bit Symbol
BC7
(0xFFFF_E210H) Read/Write (0xFFFF_E230H) After reset (0xFFFF_E250H) Function (0xFFFF_E270H) (0xFFFF_E290H) bit Symbol (0xFFFF_E2B0H) Read/Write (0xFFFF_E2D0H) After reset (0xFFFF_E2F0H) Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function
0
Fig. 10-15
Bit 23 : 0 Mnemonic BC Field name Byte count Description Byte Count (initial value: 0) Specifies the number of bytes of data to be transferred. The address decreases by the number of pieces of data transferred (a value specified by TrSiz of CCRn).
Fig. 10-16 Byte Count Register (BCRn)
TMP19A43 (rev2.0) 10-17
DMA Controller (DMAC)
TMP19A43
10.3.8
DMA Transfer Control Register (DTCRn)
7 6 5 4 DACM R/W 0 See detailed description. 15 14 13 12 11 See detailed description. 10 9 8 3 2 1 SACM R/W 0
DTCRn (0xFFFF_E218H) (0xFFFF_E238H) (0xFFFF_E258H) (0xFFFF_E278H) (0xFFFF_E298H)
bit Symbol Read/Write After reset Function bit Symbol
(0xFFFF_E2B8H) Read/Write (0xFFFF_E2D8H) After reset (0xFFFF_E2F8H) Function 23 bit Symbol Read/Write After reset Function 31 bit Symbol Read/Write After reset Function 0 30 29 28 27 26 25 24 0 22 21 20 19 18 17 16 0
Fig. 10-17
Bit 5:3 Mnemonic DACM Field name Destination address count mode Description Destination Address Count Mode Specifies the count mode of the destination address. 000: Counting begins from bit 0 001: Counting begins from bit 4 010: Counting begins from bit 8 011: Counting begins from bit 12 100: Counting begins from bit 16 101: Setting prohibited 110: Setting prohibited 111: Setting prohibited Source Address Count Mode Specifies the count mode of the source address. 000: Counting begins from bit 0 001: Counting begins from bit 4 010: Counting begins from bit 8 011: Counting begins from bit 12 100: Counting begins from bit 16 101: Setting prohibited 110: Setting prohibited 111: Setting prohibited
2:0
SACM
Source address count mode
Fig. 10-18 DMA Transfer Control Register (DTCRn)
TMP19A43 (rev2.0) 10-18
DMA Controller (DMAC)
TMP19A43
10.3.9
Data Holding Register (DHR)
7 6 DOT6 5 DOT5 4 DOT4 R/W 0 See detailed description. 15 14 DOT14 13 DOT13 12 DOT12 R/W 0 See detailed description. 23 22 DOT22 21 DOT21 20 DOT20 R/W 0 See detailed description. 31 30 DOT30 29 DOT29 28 DOT28 R/W 0 See detailed description. 27 DOT27 26 DOT26 25 DOT25 24 DOT24 DOT31 19 DOT19 18 DOT18 17 DOT17 16 DOT16 DOT23 11 DOT11 10 DOT10 9 DOT9 8 DOT8 DOT15 3 DOT3 2 DOT2 1 DOT1 0 DOT0
DHR
bit Symbol After reset Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function bit Symbol Read/Write After reset Function
DOT7
(0xFFFF_E30CH) Read/Write
Fig. 10-19
Bit 31 : 0 Mnemonic DOT Field name Data on transfer Description Data on Transfer (initial value: 0) Data that is read from the source in a dual-address data transfer mode
Fig. 10-20 Data Holding Register (DHR)
TMP19A43 (rev2.0) 10-19
DMA Controller (DMAC)
TMP19A43
10.4 Functions
The DMAC is a 32-bit DMA controller capable of transferring data in a system using the TX19A processor core at high speeds without routing data via the core.
10.4.1
Overview
(1) Source and destination The DMAC handles data transfers from memory to memory and between memory and an I/O device. A device from which data is transferred is called a source device and a device to which data is transferred is called a destination device. Both memory and I/O devices can be designated as a source or destination device. The DMAC supports data transfers from memory to I/O devices, from I/O devices to memory, and from memory to memory, but not between I/O devices. The differences between memory and I/O devices are in the way they are accessed. When accessing an I/O device, the DMAC asserts a DACKn signal. Because there is only one line per channel that carries a DACKn signal, the number of I/O devices accessible during data transfer is limited to one. Therefore, data cannot be transferred between I/O devices. An interrupt factor can be attached to a transfer request to be sent to the DMAC. If an interrupt factor is generated, the interrupt controller (INTC) issues a request to the DMAC (the TX19A processor core is not notified of the interrupt request. For details, see description on Interrupts.). The request issued by the INTC is cleared by the DACKn signal. Therefore, a request made to the DMAC is cleared after completion of each data transfer (transfer of the amount of data specified by TrSiz) if a single transfer is designated to select a transfer type (SIO BIT). On the other hand, during a continuous transfer, the DACKn signal is asserted only when the number of bytes transferred (value set in the BCRn register) becomes "0." Therefore, one transfer request allows data to be transferred successively without a pause. For example, if data is transferred between a internal I/O and the internal (external) memory of the TMP19A43, a request made by the internal I/O to the DMAC is cleared after completion of each data transfer and the transfer operation is always put in a standby mode for the next transfer request if the number of bytes transferred (value set in the BCRn register) does not become "0." Therefore, the DMA transfer operation continues until the value of the BCRn register becomes "0." (2) Bus control arbitration (bus arbitration) In response to a transfer request made inside the DMAC, the DMAC requests the TX19A processor core to arbitrate bus control authority. When a response signal is returned from the core, the DMAC acquires bus control authority and executes a data transfer bus cycle. In acquiring bus control for the DMAC, use or nonuse of the data bus of the TX19A processor core can be specified; specifically either snoop mode or non-snoop mode can be specified for each channel by using bit 11 (SReq) of the CCRn register. There are cases in which the TX19A processor core requests the release of bus control authority. Whether or not to respond to this request can be specified for each channel by using the bit 10 (RelEn) of the CCRn register. However, this function can only be used in non-snoop mode (GREQ). In snoop mode (SREQ), the TX19A processor core cannot request the release of bus control and, therefore, this function cannot be used. When there are no more transfer requests, the DMAC releases control of the bus. When there are no more transfer requests, the DMAC releases the bus control. (Note 1) Do not bring the TX19A to a halt when the DMAC is in operation. (Note 2) To put the TX19A into IDLE (doze) mode when the snoop function is being used, you must first stop the DMAC.
TMP19A43 (rev2.0) 10-20
DMA Controller (DMAC)
TMP19A43
(3) Transfer request modes Two transfer request modes are used for the DMAC: an internal transfer request mode and an external transfer request mode. In the internal transfer request mode, a transfer request is generated inside the DMAC. Setting a start bit (Str bit of the channel control register CCRn) in the internal register of the DMAC to "1" generates a transfer request, and the DMAC starts to transfer data. In the external transfer request mode, after a start bit is set to "1," a transfer request is generated when a transfer request signal INTDREQn output by the INTC is input, or when a transfer request signal DREQn output by an external device is input. For the DMAC, two modes are provided: the level mode in which a transfer request is generated when the "L" level of the INTDREQn signal is detected and a mode in which a transfer request is generated when the falling edge or "L" level of the DREQn signal is detected. (4) Address mode For the DMAC of the TMP19A43, only one address mode is provided: a dual address mode. A single address mode is not available. In the dual address mode, both single and continuous transfers are available. Source and destination device addresses are output by the DMAC. To access an I/O device, the DMAC asserts the DACKn signal. In the dual address mode, two bus operations, a read and a write, are executed. Data that is read from a source device for transfer is first put into the data holding register (DHR) inside the DMAC and then written to a destination device. (5) Channel operation The DMAC has eight channels (channels 0 through 7). A channel is activated and put into a standby mode by setting a start (Str) bit in the channel control register (CCRn) to "1." If a transfer request is generated when a channel is in a standby mode, the DMAC acquires bus control authority and transfers data. If there is no transfer request, the DMAC releases bus control authority and goes into a standby mode. If data transfer has been completed, a channel is put in an idle state. Data transfer is completed either normally or abnormally (e.g. occurrence of errors). An interrupt signal can be generated upon completion of data transfer. Fig. 10-21 shows the state transitions of channel operation.
Bus control authority not acquired Wait Start
Bus control authority not acquired Idle
Bus control authority acquired
Transfer completed
Transfer Bus control authority acquired
Fig. 10-21 Channel Operation State Transition
TMP19A43 (rev2.0) 10-21
DMA Controller (DMAC)
TMP19A43
(6) Combinations of transfer modes The DMAC can transfer data by combining each transfer mode as follows:
Transfer request Internal External
Edge/level "L" level (INTDREQn) "L" level (DREQn) Falling edge (DREQn)
Address mode
Transfer devices Continuous Single
Dual Continuous Single
External
(7) Address changes Address changes are broadly classified into three types: increases, decreases and fixed. The type of address change can be specified for each source and destination address by using SAC and DAC in the CCRn register. For a memory device, an increase, decrease or fixed can be specified. If a single transfer is selected as a source or destination device, SAC or DAC in the CCRn register must be set to "fixed". If address increase or decrease is selected, the bit position for counting can be specified using SACM or DACM in the DTCRn register. To specify the bit position for counting a source address, SACM must be used, while DACM must be used to specify the bit position for a destination address. Any of the bits 0, 4, 8, 12 and 16 can be specified as the bit position for address counting. If 0 is selected, an address normally increases or decreases. By selecting bits 4, 8, 12 or 16, it is possible to increase or decrease an address irregularly. Examples of address changes are shown below. Example 1: Monotonic increase for a source device and irregular increase for a destination device
SAC: Address increase DAC: Address increase TrSiz: Transfer unit 32 bits Source address: 0xA000_1000 Destination address: 0xB000_0000 SACM: 000 counting to begin from bit 0 of the address counter DACM: 001 counting to begin from bit 4 of the address counter Source 0xA000_1000 0xA000_1004 0xA000_1008 0xA000_100C Destination 0xB000_0000 0xB000_0010 0xB000_0020 0xB000_0030 ...
1st 2nd 3rd 4th ...
TMP19A43 (rev2.0) 10-22
DMA Controller (DMAC)
TMP19A43
Example 2: Irregular decrease for a source device and monotonic decrease for a destination device
SAC: Address decrease DAC: Address decrease TrSiz: Transfer unit 16 bits Source address: Initial value 0xA000_1000 Destination address: 0xB000_0000 SACM: 010 counting to begin from bit 8 of the address counter DACM: 000 counting to begin from bit 0 of the address counter
1st 2nd 3rd 4th
Source 0xA000_1000 0x9FFF_FF00 0x9FFF_FE00 0x9FFF_FD00 ...
Destination 0xB000_0000 0xAFFF_FFFE 0xAFFF_FFFC 0xAFFF_FFFA ...
10.4.2
Transfer Request
For the DMAC to transfer data, a transfer request must be issued to the DMAC. There are two types of transfer request: an internal transfer request and an external transfer request. Either of these transfer requests can be selected and specified for each channel. Whichever is selected, the DMAC acquires bus control authority and starts to transfer data if the transfer request is generated after the start of channel operation. * Internal transfer request If the Str bit of CCR is set to "1" when the ExR bit of CCRn is "0," a transfer request is generated immediately. This transfer request is called an internal transfer request. The internal transfer request is valid until the channel operation is completed. Therefore, data can be transferred continuously if either of two events shown below does not occur: * A transition to a channel of higher priority * A shift of bus control authority to another bus master of higher priority In the case of the internal transfer request, data can only be transferred from memory to memory. * External transfer request If the ExR bit of CCRn is "1," setting the Str bit of CCR to "1" allows a channel to go into a standby mode. The INTC or an external device then generates the INTDREQn or DREQn signal for this channel to notify the DMAC of a transfer request, and a transfer request is generated. This transfer request is called an external transfer request. The external transfer request is used for a single and a continuous transfer. The TMP19A43 recognizes the transfer request signal by detecting the "L" level of the INTDREQn signal or by detecting the falling edge or "L" level of the DREQn signal. The unit of data to be transferred in response to one transfer request is specified in the TrSiz field of CCRn, and 32, 16 or 8 bits can be selected. Transfer requests using INTDREQn and DREQn are described in detail on the next page.
TMP19A43 (rev2.0) 10-23
DMA Controller (DMAC)
TMP19A43
A transfer request made by the interrupt controller (INTC) A transfer request made by the interrupt controller is cleared using the DACKn signal. This DACKn signal is asserted only if a bus cycle for a single transfer or the number of bytes (value set in the BCRn register) transferred at continuous transfer becomes "0." Therefore, at the single transfer, the amount of data specified by TrSiz is transferred only once because INTDREQn is cleared upon completion of one data transfer from one transfer request. On the other hand, at the continuous transfer, it can be transferred successively in response to a transfer request because INTDREQn is not cleared until the number of bytes transferred (value set in the BCRn register) becomes "0." This DACKn signal is asserted only if a bus cycle for a single transfer or the number of bytes (value set in the BCRn register) transferred at continuous transfer becomes "0." Therefore, at the single transfer, the amount of data specified by TrSiz is transferred only once because INTDREQn is cleared upon completion of one data transfer from one transfer request. On the other hand, at the continuous transfer, it can be transferred successively in response to a transfer request because INTDREQn is not cleared until the number of bytes transferred (value set in the BCRn register) becomes "0." Note that if the DMAC acknowledges an interrupt set in INTDREQn and if this interrupt is cleared by the INTC before DMA transfer begins, there is a possibility that DMA transfer might be executed once after the interrupt is cleared, depending on the timing. A transfer request made by an external device External pins (DREQ0 and DREQ4) are internally wired to allow them to function as pins of the port F. These pins can be selected by setting the function control register PFFC to an appropriate setting. In the edge mode, the DREQn signal must be negated and then asserted for each transfer request to create an effective edge. In the level mode, however, successive transfer requests can be recognized by maintaining an effective level. At the continuous transfer, only the "L" level mode can be used. At the single transfer, only the falling edge mode can be used. - Level mode In the level mode, the DMAC detects the "L" level of the DREQn signal upon the rising of the internal system clock. If it detects the "L" level of the DREQn signal when a channel is in a standby mode, it goes into transfer mode and starts to transfer data. To use the DREQn signal at an active level, the PosE bit (bit 13) of the CCRn register must be set to "0." The DACKn signal is active at the "L" level, as in the case of the DREQn signal. If an external circuit asserts the DREQn signal, the DREQn signal must be maintained at the "L" level until the DACKn signal is asserted. If the DREQn signal is deasserted before the DACKn signal is asserted, a transfer request may not be recognized. If the DREQn signal is not at the "L" level, the DMAC judges that there is no transfer request, and starts a transfer operation for other channels or releases bus control authority and goes into a standby mode. The unit of a transfer request is specified in the TrSiz field () of the CCRn register.
TMP19A43 (rev2.0) 10-24
DMA Controller (DMAC)
TMP19A43
DREQn
A[31:1]
Transfer data
DACKn
Fig. 10-22 Transfer Request Timing (Level Mode)
TMP19A43 (rev2.0) 10-25
DMA Controller (DMAC)
TMP19A43
- Edge mode In the edge mode, the DMAC detects the falling edge of the DREQn signal. If it detects the falling edge of the DREQn signal upon the rising of the internal system clock (the case in which the "L" level is detected upon the rising of the system clock although it was not detected upon the rising of the previous system clock) when a channel is in a standby mode, it judges that there is a transfer request, goes into transfer mode, and starts a transfer operation. To detect the falling edge of the DREQn signal, the PosE bit (bit 13) of the CCRn register must be set to "0," and the Lev bit (bit 12) must also be set to "0." The DACKn signal is active at the "L" level. If the falling edge of the DREQn signal is detected after the DACKn signal is asserted, the next data is transferred without a pause. If there is no falling edge of the DREQn signal after the DACKn signal is asserted, the DMAC judges that there is no transfer request, and starts a transfer operation for other channels or goes into a standby mode after releasing bus control authority. The unit of a transfer request is specified in the TrSiz field () of the CCRn register.
DREQn
A[31:1]
Transfer data
Transfer data
DACKn
Fig. 10-23 Transfer Request Timing (Edge Mode)
Start factor is DMA interrupt. Instruction of the transmission demand cannot be done by the instruction. There is a possibility that the DMA start factor remains after the DMA forwarding ends last time. In DMA Interrupt, transmission the dummy.
CCRx SARx DARx BCRx DTCRx CCRx
= = = = = =
Setting; (RAM address) (RAM address) 0x01; 0x00; (Channel start)
DMA Demand Transmission Dummy
TMP19A43 (rev2.0) 10-26
DMA Controller (DMAC)
TMP19A43
Address Mode
In the address mode, whether the DMAC executes data transfers by outputting addresses to both source and destination devices or it does by outputting addresses to either a source device or a destination device is specified. The former is called the dual address mode, and the latter is called the single address mode. For TMP19A43, only the dual address mode is available. In the dual address mode, The DMAC first performs a read of the source device by storing the data output by the source device in one of its registers (DHR). It then executes a write on the destination device by writing the stored data to the device, thereby completing the data transfer.
DMAC
Source device
Address Address bus
Data Data bus
Destination device
Fig. 10-24 Basic Concept of Data Transfer in the Dual Address Mode The unit of data to be transferred by the DMAC is the amount of data (32, 16 or 8 bits) specified in the TrSiz field of the CCRn. One unit of data is transferred each time a transfer request is acknowledged. In the dual address mode, the unit of data is read from the source device, put into the DHR and written to the destination device. Access to memory takes place when the specified unit of data is transferred. If access to external memory takes place, 16-bit access takes place twice if the unit of data is set to 32 bits and if the bus width set in the CS wait controller is 16 bits. Likewise, if the unit of data is set to 32 bits and if the bus width set in the CS wait controller is 8 bits, 8-bit access takes place four times. If data is to be transferred from memory to an I/O device or from an I/O device to memory, the unit of data to be transferred must be specified and, at the same time, the bus width of an I/O device (device port size) must be specified in the DPS field of the CCRn (32, 16 or 8 bits).
TMP19A43 (rev2.0) 10-27
DMA Controller (DMAC)
TMP19A43
If the unit of data to be transferred is equal to a device port size, a read or write is executed once for an I/O device. If a device port size is smaller than the unit of data to be transferred, the DMAC performs a read or write for an I/O device more than once. For example, if the unit of data to be transferred is 32 bits and if data is transferred from an I/O device whose device port size is 8 bits to memory, 8 bits of data are read from an I/O device four consecutive times and stored in the DHR. This 32-bit data is then written to memory all at once (twice if the data is written to external memory and if the bus width is 16 bits). An address change occurs by the amount defined as the unit of data to be transferred. The BCRn value also changes by the same amount. A device port size must not be larger than the unit of data to be transferred. The relationships between units of data to be transferred and device port sizes are summarized in Table 10.1. Table 10.1 Units of Data to Be Transferred and Device Port Sizes (Dual Address Mode)
TrSiz 0x (32 bits) 0x (32 bits) 0x (32 bits) 10 (16 bits) 10 (16 bits) 10 (16 bits) 11 (8 bits) 11 (8 bits) 11 (8 bits) DPS 0x (32 bits) 10 (16 bits) 11 (8 bits) 0x (32 bits) 10 (16 bits) 11 (8 bits) 0x (32 bits) 10 (16 bits) 11 (8 bits) Bus operations performed on I/O device Once Twice 4 times Setting prohibited Once Twice Setting prohibited Setting prohibited Once
TMP19A43 (rev2.0) 10-28
DMA Controller (DMAC)
TMP19A43
10.4.3
Channel Operation
A channel is activated if the Str bit of the CCRn of a channel is set to "1." If a channel is activated, an activation check is conducted and if no error is detected, the channel is put into a standby mode. If a transfer request is generated when a channel is in a standby mode, the DMAC acquires bus control authority and starts to transfer data. Channel operation is completed either normally or abnormally (forced termination or occurrence of an error). Either normal completion or abnormal completion is indicated to the CSRn. Start of channel operation A channel is activated if the Str bit of the CCRn is set to "1." When a channel is activated, a configuration error check is conducted and if no error is detected, the channel is put into a standby mode. If an error is detected, the channel is deactivated and this state of completion is considered to be abnormal completion. When a channel goes into a standby mode, the Act bit of the CSRn of that channel becomes "1." If a channel is programmed to start operation in response to an internal transfer request, a transfer request is generated immediately and the DMAC acquires bus control authority and starts to transfer data. If a channel is programmed to start operation in response to an external transfer request, the DMAC acquires bus control authority after INTDREQn or DREQn is asserted, and starts to transfer data. Completion of channel operation A channel completes operation either normally or abnormally and either one of these states is indicated to the CSRn. If an attempt is made to set the Str bit of the CCRn register to "1" when the NC or AbC bit of the CSRn register is "1," channel operation does not start and the completion of operation is considered to be abnormal completion. Normal completion Channel operation is considered to have been completed normally in the case shown below. For channel operation to be considered to have been completed normally, the transfer of a unit of data (value specified in the TrSiz field of CCRn) must be completed successfully. * When the contents of BCRn become 0 and data transfer is completed
Abnormal completion Cases of abnormal completion of DMAC operation are as follows: * Completion due to a configuration error A configuration error occurs if there is a mistake in the DMA transfer setting. Because a configuration error occurs before data transfer begins, values specified in SARn, DARn and BCRn remain the same as when they were initially specified. If channel operation is completed abnormally due to a configuration error, the AbC bit of the CSRn is set to "1," along with the Conf bit. Causes of a configuration error are as follows: - - - - Both SIO and DIO were set to "1." The Str bit of CCRn was set to "1" when the NC bit or AbC bit of CSRn was "1." A value that is not an integer multiple of the unit of data was set for BCRn. A value that is not an integer multiple of the unit of data was set for SARn or DARn.
TMP19A43 (rev2.0) 10-29
DMA Controller (DMAC)
TMP19A43
- - *
A prohibited combination of a device port size and a unit of data to be transferred was set. The Str bit of CCRn was set to "1" when the BCRn value was "0."
Completion due to a bus error If the DMAC operation has been completed abnormally due to a bus error, the AbC bit of CSRn is set to "1" and the BES or BED bit of CSRn is set to "1." - A bus error was detected during data transfer.
(Note)
If the DMAC operation has been completed abnormally due to a bus error, BCR, SAR and DAR values cannot be guaranteed. If a bus error persists, refer to 21. "List of Functional Registers" which appear later in this document.
10.4.4
Order of Priority of Channels
Concerning the eight channels of the DMAC, the smaller the channel number assigned to each channel, the higher the priority. If a transfer request is generated to channels 0 and 1 simultaneously, a transfer request for channel 0 is processed with higher priority and the transfer operation is performed accordingly. When the transfer request for channel 0 is cleared, the transfer operation for channel 1 is performed if the transfer request still exists (An internal transfer request is retained if it is not cleared. The interrupt controller retains an external transfer request if the active state for an interrupt request assigned to DMA requests in the interrupt controller is set to edge mode. However, the interrupt controller does not retain an external transfer request if the active state is set to level mode. If the active state for an interrupt request assigned to DMA requests in the interrupt controller is set to level mode, it is necessary to continue asserting the interrupt request signal). If a transfer request is generated when data is being transferred through channel 1, a channel transition occurs at channel 0, that is, data transfer through channel 1 is temporarily suspended and data transfer through channel 0 is started. When the transfer request for channel 0 is cleared, data transfer through channel 1 resumes. Channel transitions occur upon the completion of data transfers (when the writing of all data in the DHR has been completed). Interrupts Upon completion of a channel operation, the DMAC can generate interrupt requests (INTDMAn: DMA transfer completion interrupt) to the TX19A processor core with two types of interrupts available: a normal completion interrupt and an abnormal completion interrupt. INTDMA0: 0ch through 3ch * Normal completion interrupt If a channel operation is completed normally, the NC bit of CSRn is set to "1." If a normal completion interrupt is authorized for the NIEn bit of the CCRn, the DMAC requests the TX19A processor core to authorize an interrupt. * Abnormal completion interrupt If a channel operation is completed abnormally, the AbC bit of CSRn is set to "1." If an abnormal completion interrupt is authorized for the AbIEn bit of the CCRn, the DMAC requests the TX19A processor core to authorize an interrupt. (Note) The DMA transfer completion interrupt comes in two types: INTDMA0 for 0ch through 3ch and INTDMA1 for 4ch through 7ch. INTDMA1: 4ch through 7ch
TMP19A43 (rev2.0) 10-30
DMA Controller (DMAC)
TMP19A43
10.5 Timing Diagrams
DMAC operations are synchronous to the rising edges of the internal system clock.
10.5.1
Dual Address Mode
* Continuous transfer Fig. 10-25 shows an example of the timing with which 16-bit data is transferred from one external memory (16-bit width) to another (16-bit width). Data is actually transferred successively until BCRn becomes "0."
tsys A [23 : 0]
CS0 CS1
RD WR / HWR
D [15 : 0]
Data
Data
Read
Write
Fig. 10-25 Dual Address Mode (Memory-to-Memory) * Memory-to-I/O device transfer Fig. 10-26 shows an example of the timing with which data is transferred from memory to an I/O device if the unit of data to be transferred is set to 16 bits and if the device port size is set to 8 bits.
tsys A [23 : 0]
CS0 CS1
RD WR
D [15 : 0]
Data Data Data
Read
Write
Write
Fig. 10-26 Dual Address Mode (Memory-to-I/O Device)
TMP19A43 (rev2.0) 10-31
DMA Controller (DMAC)
TMP19A43
*
I/O device-to-memory transfer Fig. 10-27 shows an example of the timing with which data is transferred from an I/O device to memory if the unit of data to be transferred is set to 16 bits and if the device port size is set to 8 bits.
tsys A [23 : 0]
CS0 CS1
RD WR / HWR
D [15 : 0]
Data
Data
Data
Read
Read
Write
Fig. 10-27 Dual Address Mode (I/O Device-to-Memory)
TMP19A43 (rev2.0) 10-32
DMA Controller (DMAC)
TMP19A43
10.5.2
DREQn-Initiated Transfer Mode
* Data transfer from internal RAM to external memory (multiplexed bus, 5-wait insertion, level mode) Fig. 10-28 shows two timing cycles in which 16-bit data is transferred twice from internal RAM to external memory (16-bit width).
(7+) clock 5 waits
Internal system clock DREQn DACKn ALE A [23:16] AD [15:0] RD WR HWR CSn R/W
Add Add Data Add Data
Fig. 10-28 Level Mode (from Internal RAM to External Memory)
*
Data transfer from external memory to internal RAM (multiplexed bus, 5-wait insertion, level mode) Fig. 10-29 shows two timing cycles in which 16-bit data is transferred twice from external memory (16-bit width) to internal RAM.
(7+) clock Internal system clock DREQ DACKn ALE A [23:16] AD [15:0] RD WR HWR CSn R/W
Add
5 waits
Add Data Add Data
Fig. 10-29 Level Mode (from External Memory to Internal RAM)
TMP19A43 (rev2.0) 10-33
DMA Controller (DMAC)
TMP19A43
*
Data transfer from internal RAM to external memory (separate bus, 5-wait insertion, level mode) Fig. 10-30 shows two timing cycles in which 16-bit data is transferred twice from internal RAM to external memory (16-bit width).
(7+) clock 5 waits
Internal system clock DREQn DACKn A [23:0] D [15:0] RD WR HWR CSn R/W
Add Data Data
Fig. 10-30 Level Mode (Internal RAM to External Memory)
*
Data transfer from external memory to internal RAM (separate bus, 5-wait insertion, level mode) Fig. 10-31 shows two timing cycles in which 16-bit data is transferred twice from external memory (16-bid width) to internal RAM.
(7+) clock 5 waits
Internal system clock
DREQ DACKn A [23:0] A [15:0] RD WR HWR CSn R/W
Add Data Data
Fig. 10-31 Level Mode (from External Memory to Internal RAM)
TMP19A43 (rev2.0) 10-34
DMA Controller (DMAC)
TMP19A43
*
Data transfer from internal RAM to external memory (multiplexed bus, 5-wait insertion, edge mode) Fig. 10-32 shows one timing cycle in which 16-bit data is transferred once from internal RAM to external memory (16-bit width).
(7+) clock 5 waits
Internal system clock DREQn DACKn ALE A [23:16] AD [15:0] RD WR HWR CSn R/W
Add Add Data
Fig. 10-32 Edge Mode (from Internal RAM to External Memory)
*
Data transfer from external memory to internal RAM (multiplexed bus, 5-wait insertion, edge mode) Fig. 10-33 shows one timing cycle in which 16-bit data is transferred once from external memory (16-bit width) to internal RAM.
(7+) clock 5 waits
Internal system clock DREQn DACKn ALE A [23:16] AD [15:0] RD WR HWR CSn R/W
Add Add Data
Fig. 10-33 Edge Mode (from External Memory to Internal RAM)
TMP19A43 (rev2.0) 10-35
DMA Controller (DMAC)
TMP19A43
*
Data transfer from internal RAM to external memory (separate bus, 5-wait insertion, edge mode) Fig. 10-34 shows one timing cycle in which 16-bit data is transferred once from internal RAM to external memory (16-bit width).
(7+) clock 5 waits
Internal system clock DREQn DACKn A [23:0] D [15:0] RD WR HWR CSn R/W
Add Data
Fig. 10-34 Edge Mode (from Internal RAM to External Memory)
*
Data transfer from external memory to internal RAM (separate bus, 5-wait insertion, edge mode) Fig. 10-35 shows one timing cycle in which 16-bit data is transferred once from external memory (16-bit width) to internal RAM.
(7+) clock 5 waits
Internal system clock DREQn DACKn A [23:0] D [15:0] RD WR HWR CSn R/W
Add Data
Fig. 10-35 Edge Mode (from External Memory to Internal RAM)
TMP19A43 (rev2.0) 10-36
DMA Controller (DMAC)
TMP19A43
10.6 Case of Data Transfer
The settings described below relate to a case in which serial data received (SCnBUF) is transferred to the internal RAM by DMA transfer. DMA (ch.0) is used to transfer data. The DMA0 is activated by a receive interrupt generated by SIO1. * * * * * * * Channel used: 0 Source address: SC1BUF Destination: (Physical address) 0xFFFF_9800 Number of bytes transferred: 256 bytes Data length 8 bits: UART Serial channel: ch 1 Transfer rate: 9600 bps



IMC5LL INTCLR SC1MOD0 SC1CR x111, x100 0x050 0x29 0x00 /* assigned to DMC0 activation factor * / /* IVR [8:0], INTRX1 interrupt factor * / /* UART mode, 8-bit length, baud rate generator * /
BR1CR
DCR IMCFHL INTCLR IMCFHL DTCR0

0x1F
/* @fc = 40 MHz */
0x8000_0000 x000, x000 0x0F8 x000, x100 0x0000_0000
/* DMA reset * / /* disable interrupt * / /* IVR [8:0] value * / /* level = 4 (any given value) */ /* DACM = 000 * / /* SACM = 000 * /
SAR0 DAR0 BCR0 CCR0
(Contents)

0xFFFF_F208 0xFFFF_9800 0x0000_00FF 0x80C0_5B0F
/* physical address of SC1BUF */ /* physical address of destination to which data is transferred */ /* 256 (number of bytes transferred) / /* DMA ch.0 setting */
31
27
23
19
1000000011000000 15 11 7 3
01011x11x0001111
Start factor is DMA interrupt. Instruction of the transmission demand cannot be done by the instruction. There is a possibility that the DMA start factor remains after the DMA forwarding ends last time. In DMA Interrupt, transmission the dummy.
TMP19A43 (rev2.0) 10-37
DMA Controller (DMAC)
TMP19A43
11. 16-bit Timer/Event Counters (TMRBs)
Each of the sixteen channels (TMRB0 through TMRF) has a multi-functional, 16-bit timer/event counter. TMRBs operate in the following four operation modes: * * * * * 16-bit interval timer mode 16-bit event counter mode 16-bit programmable square-wave output (PPG) mode (simultaneous output in units of four channels can be programmed) Two-phase pulse input counter mode (quad/nomal-speed, TMRB2, TMRB3, TMRB6 and TMRB7 only) Timer synchronous mode * * * Frequency measurement mode Pulse width measurement mode Time difference measurement mode
The use of the capture function allows TMRBs to operate in three other modes:
Each channel consists of a 16-bit up-counter, two 16-bit timer registers (one of which is double-buffered), two 16-bit capture registers, two comparators, a capture input control, a timer flip-flop and its associated control circuit. Timer operation modes and the timer flip-flop are controlled by a 13-byte register. Each channel (TMRB0 through TMRBF) functions independently and while the channels operate in the same way, there are differences in their specifications as shown in Table 11-1 and the two-phase pulse count function. Therefore, the operational descriptions here are for TMRB0 only and for the two-phase pulse count function (TMRB2, TMRB3, TMRB6 and TMRB7) only.
TMP19A43(rev2.0) 11-1
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Table 11-1 Differences in the Specifications of TMRB Modules
Channel Specification
External pins Internal signals External clock/ capture trigger input pins Timer flip-flop output pin Timer for capture triggers Timer RUN register Timer control register Timer mode register Timer flip-flop control register Timer status register Register Timer UC preset register names (addresses) Timer register
TMRB0
TB0IN0 (shared with P20) TB0IN1 (shared with P21) TB0OUT (shared with P54) TB0RUN (0xFFFF_F140) TB0CR (0xFFFF_F141) TB0MOD (0xFFFF_F142) TB0FFCR (0xFFFF_F143) TB0ST (0xFFFF_F144) TB0UCL TB0UCH TB0RG0L (0xFFFF_F148) TB0RG0H (0xFFFF_F149) TB0RG1L (0xFFFF_F14A) TB0RG1H (0xFFFF_F14B) TB0CP0L (0xFFFF_F14C) TB0CP0H (0xFFFF_F14D) TB0CP1L (0xFFFF_F14E) TB0CP1H (0xFFFF_F14F)
TMRB1
TB1IN0 (shared with P22) TB1IN1 (shared with P23) TB1OUT (shared with P55) TB0OUT TB1RUN (0xFFFF_F150) TB1CR (0xFFFF_F151) TB1MOD (0xFFFF_F152) TB1FFCR (0xFFFF_F153) TB1ST (0xFFFF_F154) TB1UCL TB1UCH TB1RG0L (0xFFFF_F158) TB1RG0H (0xFFFF_F159) TB1RG1L (0xFFFF_F15A) TB1RG1H (0xFFFF_F15B) TB1CP0L (0xFFFF_F15C) TB1CP0H (0xFFFF_F15D) TB1CP1L (0xFFFF_F15E) TB1CP1H (0xFFFF_F15F)
TMRB2
TB2IN0 (shared with PA6) TB2IN1 (shared with PA7) TB2OUT (shared with P56) TB0OUT TB2RUN (0xFFFF_F160) TB2CR (0xFFFF_F161) TB2MOD (0xFFFF_F162) TB2FFCR (0xFFFF_F163) TB2ST (0xFFFF_F164) TB2UCL TB2UCH TB2RG0L (0xFFFF_F168) TB2RG0H (0xFFFF_F169) TB2RG1L (0xFFFF_F16A) TB2RG1H (0xFFFF_F16B) TB2CP0L (0xFFFF_F16C) TB2CP0H (0xFFFF_F16D) TB2CP1L (0xFFFF_F16E) TB2CP1H (0xFFFF_F16F)
TMRB3
TB3IN0 (shared with PB0) TB3IN1 (shared with PB1) TB3OUT (shared with P57) TB0OUT TB3RUN (0xFFFF_F170) TB3CR (0xFFFF_F171) TB3MOD (0xFFFF_F172) TB3FFCR (0xFFFF_F173) TB3ST (0xFFFF_F174) TB3UCL TB3UCH TB3RG0L (0xFFFF_F178) TB3RG0H (0xFFFF_F179) TB3RG1L (0xFFFF_F17A) TB3RG1H (0xFFFF_F17B) TB3CP0L (0xFFFF_F17C) TB3CP0H (0xFFFF_F17D) TB3CP1L (0xFFFF_F17E) TB3CP1H (0xFFFF_F17F)
Capture register
Channel Specification
External pins Internal signals External clock/ capture trigger input pins Timer flip-flop output pin Timer for capture triggers Timer RUN register Timer control register Timer mode register Timer flip-flop control register Timer status register Register Timer UC preset register names (addresses) Timer register
TMRB4
TB4IN0 (shared with P24) TB4IN1 (shared with P25) TB4OUT (shared with P66)
TMRB5
TB5IN0 (shared with P26) TB5IN1 (shared with P27) TB5OUT (shared with P67)
TMRB6
TB6IN0 (shared with PA0) TB6IN1 (shared with PA1) TB6OUT (shared with P90)
TMRB7
TB7IN0 (shared with PA2) TB7IN1 (shared with PA3) TB7OUT (shared with P91)
TB0OUT
TB4RUN (0xFFFF_F180) TB4CR (0xFFFF_F181) TB4MOD (0xFFFF_F182) TB4FFCR (0xFFFF_F183) TB4ST (0xFFFF_F184) TB4UCL TB4UCH TB4RG0L (0xFFFF_F188) TB4RG0H (0xFFFF_F189) TB4RG1L (0xFFFF_F18A) TB4RG1H (0xFFFF_F18B) TB4CP0L (0xFFFF_F18C) TB4CP0H (0xFFFF_F18D) TB4CP1L (0xFFFF_F18E) TB4CP1H (0xFFFF_F18F)
TB0OUT
TB5RUN (0xFFFF_F190) TB5CR (0xFFFF_F191) TB5MOD (0xFFFF_F192) TB5FFCR (0xFFFF_F193) TB5ST (0xFFFF_F194) TB5UCL TB5UCH TB5RG0L (0xFFFF_F198) TB5RG0H (0xFFFF_F199) TB5RG1L (0xFFFF_F19A) TB5RG1H (0xFFFF_F19B) TB5CP0L (0xFFFF_F19C) TB5CP0H (0xFFFF_F19D) TB5CP1L (0xFFFF_F19E) TB5CP1H (0xFFFF_F19F)
TB0OUT
TB6RUN (0xFFFF_F1A0) TB6CR (0xFFFF_F1A1) TB6MOD (0xFFFF_F1A2) TB6FFCR (0xFFFF_F1A3) TB6ST (0xFFFF_F1A4) TB6UCL TB6UCH TB6RG0L (0xFFFF_F1A8) TB6RG0H (0xFFFF_F1A9) TB6RG1L (0xFFFF_F1AA) TB6RG1H (0xFFFF_F1AB) TB6CP0L (0xFFFF_F1AC) TB6CP0H (0xFFFF_F1AD) TB6CP1L (0xFFFF_F1AE) TB6CP1H (0xFFFF_F1AF)
TB0OUT
TB7RUN (0xFFFF_F1B0) TB7CR (0xFFFF_F1B1) TB7MOD (0xFFFF_F1B2) TB7FFCR (0xFFFF_F1B3) TB7ST (0xFFFF_F1B4) TB7UCL TB7UCH TB7RG0L (0xFFFF_F1B8) TB7RG0H (0xFFFF_F1B9) TB7RG1L (0xFFFF_F1BA) TB7RG1H (0xFFFF_F1BB) TB7CP0L (0xFFFF_F1BC) TB7CP0H (0xFFFF_F1BD) TB7CP1L (0xFFFF_F1BE) TB7CP1H (0xFFFF_F1BF)
Capture register
TMP19A43(rev2.0) 11-2
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Channel Specification
External pins Internal signals External clock/ capture trigger input pins Timer flip-flop output pin Timer for capture triggers Timer RUN register Timer control register Timer mode register Timer flip-flop control register Timer status register Register Timer UC preset register names (addresses) Timer register
TMRB8
TB8IN0 (shared with PA4) TB8IN1 (shared with PA5x) TB8OUT (shared with P92) TB8RUN (0xFFFF_F1C0) TB8CR (0xFFFF_F1C1) TB8MOD (0xFFFF_F1C2) TB8FFCR (0xFFFF_F1C3) TB8ST (0xFFFF_F1C4) TB8UCL TB8UCH TB8RG0L (0xFFFF_F1C8) TB8RG0H (0xFFFF_F1C9) TB8RG1L (0xFFFF_F1CA) TB8RG1H (0xFFFF_F1CB) TB8CP0L (0xFFFF_F1CC) TB8CP0H (0xFFFF_F1CD) TB8CP1L (0xFFFF_F1CE) TB8CP1H (0xFFFF_F1CF)
TMRB9
TB9OUT (shared with P96) TB8OUT TB9RUN (0xFFFF_F1D0) TB9CR (0xFFFF_F1D1) TB9MOD (0xFFFF_F1D2) TB9FFCR (0xFFFF_F1D3) TB9ST (0xFFFF_F1D4) TB9UCL TB9UCH TB9RG0L (0xFFFF_F1D8) TB9RG0H (0xFFFF_F1D9) TB9RG1L (0xFFFF_F1DA) TB9RG1H (0xFFFF_F1DB) TB9CP0L (0xFFFF_F1DC) TB9CP0H (0xFFFF_F1DD) TB9CP1L (0xFFFF_F1DE) TB9CP1H (0xFFFF_F1DF)
TMRBA
TBAOUT (shared with P97) TB8OUT TBARUN (0xFFFF_F1E0) TBACR (0xFFFF_F1E1) TBAMOD (0xFFFF_F1E2) TBAFFCR (0xFFFF_F1E3) TBAST (0xFFFF_F1E4) TBAUCL TBAUCH TBARG0L (0xFFFF_F1E8) TBARG0H (0xFFFF_F1E9) TBARG1L (0xFFFF_F1EA) TBARG1H (0xFFFF_F1EB) TBACP0L (0xFFFF_F1EC) TBACP0H (0xFFFF_F1ED) TBACP1L (0xFFFF_F1EE) TBACP1H (0xFFFF_F1EF)
TMRBB
TBBOUT (shared with PD3) TB8OUT TBBRUN (0xFFFF_F1F0) TBBCR (0xFFFF_F1F1) TBBMOD (0xFFFF_F1F2) TBBFFCR (0xFFFF_F1F3) TBBST (0xFFFF_F1F4) TBBUCL TBBUCH TBBRG0L (0xFFFF_F1F8) TBBRG0H (0xFFFF_F1F9) TBBRG1L (0xFFFF_F1FA) TBBRG1H (0xFFFF_F1FB) TBBCP0L (0xFFFF_F1FC) TBBCP0H (0xFFFF_F1FD) TBBCP1L (0xFFFF_F1FE) TBBCP1H (0xFFFF_F1FF)
Capture register
Channel Specification
External pins Internal signals External clock/ capture trigger input pins Timer flip-flop output pin Timer for capture triggers Timer RUN register Timer control register Timer mode register Timer flip-flop control register Timer status register Register Timer UC preset register names (addresses) Timer register
TMRBC
-
TMRBD
-
TMRBE
-
TMRBF
- TBFOUT (shared with P47) TB8OUT TBFRUN (0xFFFF_F230) TBFCR (0xFFFF_F231) TBFMOD (0xFFFF_F232) TBFFFCR (0xFFFF_F233) TBFST (0xFFFF_F234) TBFUCL TBFUCH TBFRG0L (0xFFFF_F238) TBFRG0H (0xFFFF_F239) TBFRG1L (0xFFFF_F23A) TBFRG1H (0xFFFF_F23B) TBFCP0L (0xFFFF_F23C) TBFCP0H (0xFFFF_F23D) TBFCP1L (0xFFFF_F23E) TBFCP1H (0xFFFF_F23F)
TBCOUT (shared with PD4) TBDOUT (shared with PD5) TBEOUT (shared with P32) TB8OUT TBCRUN (0xFFFF_F200) TBCCR (0xFFFF_F201) TBCMOD (0xFFFF_F202) TBCFFCR (0xFFFF_F203) TBCST (0xFFFF_F204) TBCUCL TBCUCH TBCRG0L (0xFFFF_F208) TBCRG0H (0xFFFF_F209) TBCRG1L (0xFFFF_F20A) TBCRG1H (0xFFFF_F20B) TBCCP0L (0xFFFF_F20C) TBCCP0H (0xFFFF_F20D) TBCCP1L (0xFFFF_F20E) TBCCP1H (0xFFFF_F20F) TB8OUT TBDRUN (0xFFFF_F210) TBDCR (0xFFFF_F211) TBDMOD (0xFFFF_F212) TBDFFCR (0xFFFF_F213) TBDST (0xFFFF_F214) TBDUCL TBDUCH TBDRG0L (0xFFFF_F218) TBDRG0H (0xFFFF_F219) TBDRG1L (0xFFFF_F21A) TBDRG1H (0xFFFF_F21B) TBDCP0L (0xFFFF_F21C) TBDCP0H (0xFFFF_F21D) TBDCP1L (0xFFFF_F21E) TBDCP1H (0xFFFF_F21F) TB8OUT TBERUN (0xFFFF_F220) TBECR (0xFFFF_F221) TBEMOD (0xFFFF_F222) TBEFFCR (0xFFFF_F223) TBEST (0xFFFF_F224) TBEUCL TBEUCH TBERG0L (0xFFFF_F228) TBERG0H (0xFFFF_F229) TBERG1L (0xFFFF_F22A) TBERG1H (0xFFFF_F22B) TBECP0L (0xFFFF_F22C) TBECP0H (0xFFFF_F22D) TBECP1L (0xFFFF_F22E) TBECP1H (0xFFFF_F22F)
Capture register
TMP19A43(rev2.0) 11-3
16-bit Timer/Event Counters (TMRBs)
Internal data bus
Internal data bus
Prescaler clock: T0 2 T1 T4 Capture register 0 TB0CP0H/L TB0MOD Capture control TB0RUN TB0MOD Count clock 16-bit up-counter (UC0) Capture register 1 TB0CP1H/L T16 4
run/ clear TB0RUN 8 16 32
Timer flip-flop Timer flip-flop control TB0FF0
Timer flip-flop output TB0OUT
TBOUT TB0IN0 TB0IN1 Selector TB0MOD T1 T4 T16 TB0MOD
Match detection
11.1 Block Diagram of Each Channel
TMRB0 interrupt INTTB0
Fig. 11-1 TMRB0 Block Diagram (Same for Channels 1, 4, 5 and 8 through F)
Match detection 16-bit comparator (CP1)
TMP19A43(rev2.0) 11-4
16-bit comparator (CP0) 16-bit timer register TB0RG0H/L TB0RUN Register buffer 0 Internal data bus
16-bit timer status register TB0ST
Register 0 interrupt output
Register 1 interrupt output
Overflow interrupt output
16-bit timer register TB0RG1H/L
TMP19A43
16-bit Timer/Event Counters (TMRBs)
Internal data bus
Internal data bus
Internal data bus
Prescaler clock : T0 2 T1 T16 Capture register 0 TB2CP0H/L Capture register 1 TB2CP1H/L Timer flip-flop Timer flip-flop control TB2FF0 TB2MOD T4 4
run/ clear TB2RUN 8 16 32
TBOUT TB2IN0 TB2IN1 TB2RUN TB2MOD 16-bit up-and-down counter (UC0) TB2RUN Selector Count Up-and-down control
TB2MOD Capture control
Timer flip-flop output TB2OUT
Fig. 11-2 TMRB2 Block Diagram (Same for Channels 3, 6 and 7)
TMP19A43(rev2.0) 11-5
16-bit comparaotr (CP0)
Match detection
TMRB2 interrupt INTTB2
Match detection 16-bit comparator (CP1)
Up-and-down interrupt output
Register 0 interrupt output
Register 1 interrupt output
Underflow interrupt output
Overflow interrupt output
16-bit timer register TB2RG0H/L
TMP19A43
TB2RUN
Register buffer 0
16-bit timer register TB2RG1H/L
16-bit timer status register TB2ST
16-bit Timer/Event Counters (TMRBs)
Internal data bus
Internal data bus
TMP19A43
11.2 Description of Operations for Each Circuit
11.2.1 Prescaler
There is a 4-bit prescaler for acquiring the TMRB0 source clock. The prescaler input clock T0 is fperiph/2, fperiph/4, fperiph/8 or fperiph/16 selected by SYSCR0 in the CG. The peripheral clock, fperiph, is either fgear, a clock selected by SYSCR1 in the CG, or fc, which is a clock before it is divided by the clock gear. The operation or the stoppage of a prescaler is set with TB0RUN where writing "1" starts counting and writing "0" clears and stops counting. Table 11-2 shows prescaler output clock resolutions.
TMP19A43(rev2.0) 11-6
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Table 11-2 Prescaler Output Clock Resolutions
Release peripheral clock Clock gear value Select prescaler clock 00(fperiph/16) 000 (fc) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 100(fc/2) 0 (fgear) 110(fc/4) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 111(fc/8) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 000 (fc) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 100(fc/2) 1 (fc) 110(fc/4) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 111(fc/8) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2)
5 4 3
@ = 40MHz
Prescaler output clock resolutions T1 fc/2 (0.8s) fc/2 (0.4s) fc/2 (0.2s) fc/22(0.1s) fc/2 (1.6s) fc/25(0.8s) fc/2 (0.4s) fc/23(0.2s) fc/2 (3.2s) fc/26(1.6s) fc/2 (0.8s) fc/24(0.4s) fc/2 (6.4s) fc/27(3.2s) fc/2 (1.6s) fc/25(0.8s) fc/2 (0.8s) fc/24(0.4s) fc/2 (0.2s) fc/22(0.1s) fc/2 (0.8s) fc/24(0.4s) fc/2 (0.2s) fc/2 (0.8s) fc/24(0.4s) fc/2 (0.8s)
5 5 3 5 3 5 6 8 5 7 4 6 7 6 5
T4 fc/2 (3.2s) fc/2 (1.6s) fc/2 (0.8s) fc/24(0.4s) fc/2 (6.4s) fc/27(3.2s) fc/2 (1.6s) fc/25(0.8s) fc/2 (12.8s) fc/28(6.4s) fc/2 (3.2s) fc/26(1.6s) fc/2 (25.6s) fc/29 (12.8s) fc/2 (6.4s) fc/27(3.2s) fc/2 (3.2s) fc/26(1.6s) fc/2 (0.8s) fc/24(0.4s) fc/2 (3.2s) fc/26(1.6s) fc/2 (0.8s) fc/24(0.4s) fc/2 (3.2s) fc/26(1.6s) fc/2 (0.8s) fc/24(0.4s) fc/2 (3.2s) fc/26(1.6s) fc/2 (0.8s)
5 7 5 7 5 7 5 7 8 10 7 9 6 8 9
T16 fc/2 (12.8s) fc/28(6.4s) fc/27(3.2s) fc/26(1.6s) fc/210(25.6s) fc/29(12.8s) fc/28(6.4s) fc/27(3.2s) fc/211 (51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.4s) fc/212(102.4s) fc/211 (51.2s) fc/210(25.6s) fc/29(12.8s) fc/29(12.8s) fc/28(6.4s) fc/27(3.2s) fc/26(1.6s) fc/29(12.8s) fc/28(6.4s) fc/27(3.2s) fc/26(1.6s) fc/29(12.8s) fc/28(6.4s) fc/27(3.2s) fc/26(1.6s) fc/29(12.8s) fc/28(6.4s) fc/27(3.2s) fc/26(1.6s)
(Note 1) The prescaler output clock Tn must be selected so that TnTMP19A43(rev2.0) 11-7
16-bit Timer/Event Counters (TMRBs)
TMP19A43
11.2.2
Up-counter (UC0) and Up-counter Capture Registers (TB0UCL, TB0UCH)
This is the 16-bit binary counter that counts up in response to the input clock specified by TB0MOD. UC0 input clock can be selected from either three types - T1, T4 and T16 - of prescaler output clock or the external clock of the TB0IN0 pin. For UC0, start, stop and clear are specified by TB0RUN and if UC0 matches the TB0RG1H/L timer register, it is cleared to "0" if the setting is "clear enable." Clear enable/disable is specified by TB0MOD. If the setting is "clear disable," the counter operates as a free-running counter. The current count value of the UC0 can be captured by reading the TB0UCL and TB0UCH registers. Note Make sure that reading is performed in the order of low-order bits followed by high-order bits.
If UC0 overflow occurs, the INTTB01 overflow interrupt is generated. TMRB2, TMRB3, TMRB6 and TMRB7 have the two-phase pulse input count function. The two-phase pulse count mode is activated by TB2RUN. This counter serves as the up-and-down counter, and is initialized to 0x7FFF. If a counter overflow occurs, the initial value 0x0000 is reloaded. If a counter underflow occurs, the initial value 0xFFFF count is continued.. When the two-phase pulse count mode is not active, the counter counts up only.
11.2.3
Timer Registers (TB0RG0H/L, TB0RG1H/L)
These are 16-bit registers for specifying counter values and two registers are built into each channel. If a value set on this timer register matches that on a UC0 up-counter, the match detection signal of the comparator becomes active. To write data to the TB0RG0H/L and TB0RG1H/L timer registers, either a 2-byte data transfer instruction or a 1-byte data transfer instruction written twice in the order of low-order 8 bits followed by high-order 8 bits can be used. TB0RG0 of this timer register is paired with register buffer 0 - a double-buffered configuration. TB0RG0 uses TB0RUN to control the enabling/disabling of double buffering so that if = "0," double buffering is disabled and if = "1," it is enabled. If double buffering is enabled, data is transferred from register buffer 0 to the TB0RG0 timer register when there is a match between UC0 and TB0RG1. The values of TB0RG0H/L and TB0RG1H/L become undefined after a reset so to use a 16-bit timer, it is necessary to write data to them beforehand. A reset initializes TB0RUN to "0" and sets double buffering to "disable." To use double buffering, write data to the timer register, set to "1" and then write the following data to the register buffers. TB0RG0 and the register buffers are assigned to the same address: 0xFFFF_F148/0xFFFF_F149. If = "0," the same value is written to TB0RG0 and each register buffer; if = "1," the value is only written to each register buffer. To write an initial value to the timer register, therefore, the register buffers must be set to "disable." Note) Please rewrite neither TBxRG1 nor TBxRG0 a double buffer unused while the timer is working. Note) When a double buffer is used, data is not updated while rewriting TBxREG0. TMP19A43(rev2.0) 11-8 16-bit Timer/Event Counters (TMRBs)
TMP19A43
Capture Registers (TB0CP0H/L, TB0CP1H/L) These are 16-bit registers for latching values from the UC0 up-counter. To read data from the capture register, use either a 2- or 1-byte data transfer instruction. Please read it in order of the title in subordinate position
11.2.4
Capture
This is a circuit that controls the timing of latching values from the UC0 up-counter into the TB0CP0 and TB0CP1 capture registers. The timing with which to latch data is specified by TB0MOD . Software can also be used to import values from the UC0 up-counter into the capture register; specifically, UC0 values are taken into the TB0CP0 capture register each time "0" is written to TB0MOD. To use this capability, the prescaler must be running (TB0RUN = "1"). In the two-phase pulse count mode (for the TMRB2, TMRB3, TMRB6 and TMRB7 only), the counter value is captured by using software. (Note 1) Although a read of low-order 8 bits in the capture register suspends the capture operation, it is resumed by successively reading high-order 8 bits. (Note 2) If the timer stops after a read of low-order 8 bits, the capture operation remains suspended even after the timer restarts. Please ensure that the timer is not stopped after a read of low-order 8 bits.
11.2.5
Comparators (CP0, CP1)
These are 16-bit comparators for detecting a match by comparing set values of the UC0 up-counter with set values of the TB0RG0 and TB0RG1 timer registers. If a match is detected, INTTB0 is generated.
11.2.6
Timer Flip-flop (TB0FF0)
The timer flip-flop (TB0FF0) is reversed by a match signal from the comparator and a latch signal to the capture registers. It can be enabled or disabled to reverse by setting the TB0FFCR. The value of TB0FF0 becomes undefined after a reset. The flip-flop can be reversed by writing "00" to TB0FFCR. It can be set to "1" by writing "01," and can be cleared to "0" by writing "10." The value of TB0FF0 can be output to the timer output pin, TB0OUT (shared with P54). To enable timer output, the port 5 related registers P5CR and P5FC must be programmed beforehand.
TMP19A43(rev2.0) 11-9
16-bit Timer/Event Counters (TMRBs)
TMP19A43
11.3 Register Description
TMRBn RUN register (n=0, 1, 4, 5, 8 through F)
7
TBnRUN (0xFFFF_F1x0) Bit symbol Read/Write After reset TBnRDE R/W 0 Double Buffering 0: Disable 1: Enable R/W 0 Write "0." R/W 0 Write "0." R/W 0 Write "0."
6
5
4
3
I2TBn R/W 0
In the IDLE mode
2
TBnPRUN
1
0
TBnRUN
Function
0: Stop 1: Operate
R/W R R/W 0 0 0 Timer Run/Stop Control 0: Stop & clear 1: Count * The first bit can be read as "0."
: Controls the TMRB0 count operation. : Controls the TMRB0 prescaler operation. : Controls the operation in the IDLE mode. : Controls enabling/disabling of double buffering. (Note 1) The value read from bit 1 of TBnRUN is "0." (Note 2) Do not set bits 7 to 3 (counter operating conditions) and bits 2 to 0 (count start) simultaneously
TMRBm RUN register (m=2, 3, 6, 7)
7
TBnRUN (0xFFFF_F1x0) Bit symbol Read/Write After reset TBmRDE R/W 0 Double Buffering 0: Disable 1: Enable
6
R/W 0 Write "0."
5
UDmCK R/W 0 Sampling clock 0: fs 1: T0/4
4
TBmUDCE
3
I2TBm R/W 0 IDLE 0: Stop 1: Operate
2
TBmPRUN
1
R
0
TBmRUN R/W 0
R/W 0 Enable/ disable two-phase counter 0: Disable 1: Enable
R/W
Function
0 0 Timer Run/Stop Control 0: Stop & clear 1: Count
* The first bit can be read as "0."
: :
Controls the TMRB0 count operation. Controls the operation in the IDLE mode.
: Controls the TMRB0 prescaler operation. : Controls enabling/disabling of the two-phase pulse input count operation. Enable: The counter counts up and counts down. Disable: This is the normal timer mode and the counter counts up only. : : Selects the two-phase pulse input sampling clock. Controls enabling/disabling of double buffering.
(Note 1) The value read from bit 1 of TBmRUN is "0." (Note 2) Do not set bits 7 to 3 (counter operating conditions) and bits 2 to 0 (count start) simultaneously. Fig. 11-3 TMRB-related Registers
TMP19A43(rev2.0) 11-10
16-bit Timer/Event Counters (TMRBs)
TMP19A43
TMRBn control register (n=2, 3, 6, 7)
7
TBnCR (0xFFFF_F1x1) Bit symbol Read/Write After reset TBnEN R/W 0 TMRBn operation 0: Disable 1: Enable
6
R/W 0 Write "0."
5
R 0 This can be read as "0."
4
R 0 This can be read as "0."
3
TBnSYC R/W 0
Synchronization mode switchover 0: Individual operation 1: Synchronous operation
2
UDnNF R/W 0 Digital noise filter 0: No use 1: Use
1
UDnCNT R/W 0
Mode switch-over 0: Normal
1: Quadruple
0
R 0 This can be read as "0."
Function
TMRBn control register (n=0, 1, 4, 5, 8 through F)
7
TBnCR (0xFFFF_F1x1) Bit symbol Read/Write After reset TBnEN R/W 0 TMRBn operation 0: Disable 1: Enable
6
R/W 0 Write "0."
5
R 0 This can be read as "0."
4
R 0 This can be read as "0."
3
TBnSYC R/W 0
Synchronization mode switchover 0: Individual operation 1: Synchronous operation
2
R 0 This can be read as "0."
1
R 0 This can be read as "0."
0
R 0 This can be read as "0."
Function
: Specifies the TMRB operation. When the operation is disabled, no clock is supplied to the other registers in the TMRB module. This can reduce power dissipation. (This disables reading from and writing to the other registers.) To use the TMRB, enable the TMRB operation (set to "1") before programming each register in the TMRB module. If the TMRB operation is executed and then disabled, settings will be maintained in each register. TMRBn mode register (n=0 through F)
7
TBnMOD (0xFFFF_F1x2) Bit symbol Read/Write After reset R 0 0 This can be read as "00."
6
5
TBnCP0 W 1 Capture control by software
0: Capture by software 1: Don't care
4
TBnCPM1
3
TBnCPM0 0
2
TBnCLE R/W 0 Up-counter control
0: Clear/disable
1
TBnCLK1
0
TBnCLK0
0 Capture timing
00: Disable
Function
01: TBnIN0 TBnIN1 10: TBnIN0 TBnIN0 11: TB3OUT TB3OUT
1: Clear/enable
0 0 Selects source clock 00: TB0IN0 pin input 01: T1 10: T4 11: T16
: Selects the TMRBn timer count clock. : Clears and controls the TMRBn up-counter. "0": Disables clearing of the up-counter. "1": Clears up-counter if there is a match with timer register 1 (TBnRG1). : Specifies TMRBn capture timing. "00": Capture disable "01": Takes count values into capture register 0 (TBnCP0) upon the rising of TBnIN0 pin input. Takes count values into capture register 1 (TBnCP1) upon the rising of TBnIN1 pin input. "10": Takes count values into capture register 0 (TBnCP0) upon the rising of TBnIN0 pin input. Takes count values into capture register 1 (TBnCP1) upon the falling of TBnIN0 pin input.
TMP19A43(rev2.0) 11-11
16-bit Timer/Event Counters (TMRBs)
TMP19A43
"11": Takes count values into capture register 0 (TBnCP0) upon the rising of 16-bit timer match output (TB3OUT) and into capture register 1 (TBnCP1) upon the falling of TBxOUT (TMRB1 through TMRB7). : Captures count values by software and takes them into capture register 0 (TBnCP0). (Note) The value read from bit 5 of TBnMOD is "1." Fig. 11-4 TMRB-related Register
TMRBn flip-flop control register (n=0 through F)
7
TBnFFCR (0xFFFF_F1x3) Bit symbol Read/Write After reset R 1 1 This is always read as "11."
6
5
TBnC1T1
4
TBnC0T1
3
TBnE1T1
2
TBnE0T1
1
TBnFF0C 1
0
TBnFF0C 0
R/W 0 0 TBnFF0 reverse trigger 0: Disable trigger 1: Enable trigger
When the up-counter value is taken into TBnCP1 When the up-counter value is taken into TBnCP0
0
0
Function
When the up-counter matches TBnRG1
When the up-counter matches TBnRG0
R/W 1 1 TBnFF0 control 00: Invert 01: Set 10: Clear 11: Don't care * This is always as "11."
: Controls the timer flip-flop. "00": Reverses the value of TBnFF0 (reverse by using software). "01": Sets TBnFF0 to "1." "10": Clears TBnFF0 to "0." "11": Don't care : Reverses the timer flip-flop when the up-counter matches the timer register 0,1 (TBnRG0,1). : Reverses the timer flip-flop when the up-counter value is taken into the capture register 0,1 (TBnCP0,1). Fig. 11-5 TMRB-related Register
TMP19A43(rev2.0) 11-12
16-bit Timer/Event Counters (TMRBs)
TMP19A43
TMRBn status register (n=0, 1, 4, 5, 8 through F)
7
TBnST (0xFFFF_F1x4) Bit symbol Read/Write After reset This can be read as "0." Function
6
5
R 0
4
3
2
INTTBOFn
1
INTTBn1 R 0
0: Interrupt not generated 1: Interrupt generated
0
INTTBn0 0
0: Interrupt not generated 1: Interrupt generated
0
0: Interrupt not generated 1: Interrupt generated
: Interrupt generated if there is a match with timer register 0 (TBnRG0) : Interrupt generated if there is a match with timer register 1 (TBnRG1) : Interrupt generated if an up-counter overflow occurs (Note) If any interrupt is generated, the flag that corresponds to the interrupt is set to TBnST and the generation of interrupt is notified to INTC. The flag is cleared by reading the TBnST register.
TMRBm status register (m=2, 3, 6, 7) When TBmRUN = 0: Normal timer mode
7
TBnST (0xFFFF_F1x4) Bit symbol Read/Write After reset This can be read as "0." Function R 0
6
5
4
3
2
INTTBOFm
1
INTTBm1 R 0
0: Interrupt not generated 1: Interrupt generated
0
INTTBm0 0
0: Interrupt not generated 1: Interrupt generated
0
0: Interrupt not generated 1: Interrupt generated
: Interrupt generated if there is a match with timer register 0 (TBmRG0) : Interrupt generated if there is a match with timer register 1 (TBmRG1) : Interrupt generated if an up-counter overflow occurs (Note) If any interrupt is generated, the flag that corresponds to the interrupt is set to TBmST and the generation of interrupt is notified to INTC. The flag is cleared by reading the TBmST register.
When TBmRUN = 1: Two-phase pulse input count mode
7
TBnST (0xFFFF_F1x4) Bit symbol Read/Write After reset
6
R
5
4
INTTBUDm
3
INTTBUDFm
2
INTTBOUFm
1
R
0
0
Up-anddown count 0: Not generated 1: Generated
0 This can be read as "0."
0
Underflow 0: Not generated 1: Generated
0
Overflow 0: Not generated 1: Generated
0 This can be read as "0."
Function
INTTBUDF2: An up-and-down counter underflow occurs. INTTBOUF2: An up-and-down counter overflow occurs. INTTBUD2: An up- or down-count occurs.
: Interrupt generated if an up-and-down counter overflow occurs : Interrupt generated if an up-and-down counter underflow occurs : Interrupt generated if an up- or down-count occurs (Note) If any interrupt is generated, the flag that corresponds to the interrupt is set to TBmST and the generation of interrupt is notified to INTC. The flag is cleared by reading the TBmST register. Fig. 11-6 TMRB-related Register TMP19A43(rev2.0) 11-13 16-bit Timer/Event Counters (TMRBs)
TMP19A43
TBnRG0H/L and TBnRG1H/L timer registers
TBnRG0H/L timer registers (n=0 through F) 7
Bit symbol TBnRG0L (0xFFFF_F1x8) Read/Write After reset Function
TBnRG0L7
6
TBnRG0L6
5
TBnRG0L5
4
TBnRG0L4
3
TBnRG0L3
2
TBnRG0L2
1
TBnRG0L1
0
TBnRG0L0
W Undefined Timer count value, Data of low-order 8 bits
7
TBnRG0H (0xFFFF_F1x9) Read/Write After reset Function Bit symbol
TBnRG0H7
6
TBnRG0H6
5
TBnRG0H5
4
TBnRG0H4
3
TBnRG0H3
2
TBnRG0H2
1
TBnRG0H1
0
TBnRG0H0
W Undefined Timer count value, Data of high-order 8 bits
(Note)
To write data to the timer registers, use either a 2-byte data transfer instruction or a 1-byte data transfer instruction written twice in the order of low-order 8 bits followed by high-order 8 bits.
TBnRG1H/L timer registers (n=0 through F)
7
Bit symbol TBnRG1L (0xFFFF_F1xA) Read/Write After reset Function
TBnRG1L7
6
TBnRG1L6
5
TBnRG1L5
4
TBnRG1L4
3
TBnRG1L3
2
TBnRG1L2
1
TBnRG1L1
0
TBnRG1L0
W Undefined Timer count value, Data of low-order 8 bits
7
Bit symbol TBnRG1H (0xFFFF_F1xB) Read/Write After reset Function
TBnRG1H7
6
TBnRG1H6
5
TBnRG1H5
4
TBnRG1H4
3
TBnRG1H3
2
TBnRG1H2
1
TBnRG1H1
0
TBnRG1H0
W Undefined Timer count value, Data of high-order 8 bits
(Note)
To write data to the timer registers, use either a 2-byte data transfer instruction or a 1-byte data transfer instruction written twice in the order of low-order 8 bits followed by high-order 8 bits.
TMP19A43(rev2.0) 11-14
16-bit Timer/Event Counters (TMRBs)
TMP19A43
TBnCP0H/L and TBnCP1H/L capture registers TBnCP0H/L capture registers (n=0 through F)
7
Bit symbol TBnCP0L (0xFFFF_F1xC) Read/Write After reset Function
TBnCP0L7
6
TBnCP0L6
5
TBnCP0L5
4
TBnCP0L4
3
TBnCP0L3
2
TBnCP0L2
1
TBnCP0L1
0
TBnCP0L0
R Undefined Timer capture value, Data of low-order 8 bits
7
Bit symbol TBnCP0H (0xFFFF_F1xD) Read/Write After reset Function
TBnCP0H7
6
TBnCP0H6
5
TBnCP0H5
4
TBnCP0H4
3
TBnCP0H3
2
TBnCP0H2
1
TBnCP0H1
0
TBnCP0H0
R Undefined Timer capture value, Data of high-order 8 bits
(Note)
To read data from the capture registers, use a 1-byte data transfer instruction written twice in the order of low-order 8 bits followed by highorder 8 bits. Don't use a 2-byte data transfer instruction. TBnCP1H/L capture registers (n=0 through F)
7 6
TBnCP1L6
5
TBnCP1L5
4
TBnCP1L4
3
TBnCP1L3
2
TBnCP1L2
1
TBnCP1L1
0
TBnCP1L0
TBnCP1L (0xFFFF_F1xE)
Bit symbol Read/Write After reset Function
TBnCP1L7
R Undefined Timer capture value, Data of low-order 8 bits
7
TBnCP1H (0xFFFF_F1xF) Bit symbol Read/Write After reset Function
TBnCP1H7
6
TBnCP1H6
5
TBnCP1H5
4
TBnCP1H4
3
TBnCP1H3
2
TBnCP1H2
1
TBnCP1H1
0
TBnCP1H0
R Undefined Timer capture value, Data of high-order 8 bits
(Note)
To read data from the capture registers, use a 1-byte data transfer instruction written twice in the order of low-order 8 bits followed by highorder 8 bits. Don't use a 2-byte data transfer instruction.
TMP19A43(rev2.0) 11-15
16-bit Timer/Event Counters (TMRBs)
TMP19A43
11.4 Description of Operations for Each Mode
11.4.1 16-bit Interval Timer Mode
Generating interrupts at periodic cycles To generate the INTTB0 interrupt, specify a time interval in the TB0RG1 timer register.
7 TB0CR TB0RUN IMC8 1 0 0 0 0 0 1 0 * * 0 6 0 0 1 1 1 1 1 0 * * 0 5 X 0 1 1 1 1 0 1 * * 0 4 3 2 1 0 Starts the TMRB0 module. Stops TMRB0. Enables INTTB0, and sets it to level 4. (Setting of INTTB0 only is shown here. This is a 32-bit register and requires settings of other interrupts as well.) Disables the trigger. Designates the prescaler output clock as the input clock, and specifies the time interval. (16 bits) Starts TMRB0. XXXXX 0-0X0 00000 00000 00100 0 0 0 * * 0 0 0 0 * * - 0 0 1 * * 1 0 1 * * * X 0 1 * * * 1
TB0FFCR TB0MOD TB0RG1L TB0RG1H TB0RUN

X; Don't care -; no change
11.4.2
16-bit Event Counter Mode
By using an input clock as an external clock (TB0IN0 pin input), it is possible to make it the event counter. The up-counter counts up on the rising edge of TB0IN0 pin input. By capturing a value using software and reading the captured value, it is possible to read the count value.
7 TB0CR TB0RUN P2CR P2FC P2FC2 IMC8 1 0 - - - 0 0 0 6 0 0 - - - 1 1 1 1 1 0 0 5 X 0 - - - 1 1 1 1 0 1 0 0 * * 4 3 2 1 0 Starts the TMRB0 module. Stops TMRB0. Sets P20 to the input mode.
XXXXX 0-0X0 ----0 ----1 ----0 00000 00000 00100 0 0 0 0 0 * * 0 0 0 - 0 * * 0 0 1 1 1 * * 0 1 0 X 0 * * 0 1 0 1 0 * *
Enables INTTB0, and sets it to level 4. (Setting of INTTB0 only is shown here. This is a 32-bit register and requires settings of other interrupts as well.) Disables the trigger. Designates the TB0IN0 pin input as the input clock. Starts TMRB0. Captures a value using software. Specifies the time interval. (16 bits)
TB0FFCR TB0MOD TB0RUN TB0MOD TB0RG1L TB0RG1H
0 1 0 0
XX * * **
X; Don't care -; no change To be used as the event counter, put the prescaler in a "RUN" state (TB0RUN = "1").
TMP19A43(rev2.0) 11-16
16-bit Timer/Event Counters (TMRBs)
TMP19A43
11.4.3
16-bit PPG (Programmable Square Wave) Output Mode
Square waves with any frequency and any duty (programmable square waves) can be output. The output pulse can be either low-active or high-active. Programmable square waves can be output from the TB0OUT pin by triggering the timer flip-flop (TB0FF) to reverse when the set value of the up-counter matches the set values of the timer registers (TB0RG0H/L and TB0RG1H/L). Note that the set values of TB0RG0H/L and TB0RG1H/L must satisfy the following requirement: (Set value of TB0RG0H/L) < (Set value of TB0RG1H/L)
Match with TB0RG0H/L (INTTB0 interrupt) Match with TB0RG1H/L (INTTB1 interrupt) TB0OUT pin
Fig. 11-7 Example of Output of Programmable Square Wave (PPG) In this mode, by enabling the double buffering of TB0RG0H/L, the value of register buffer 0 is shifted into TB0RG0H/L when the set value of the up-counter matches the set value of TB0RG1H/L. This facilitates handling of small duties.
Match with TB0RG0 Match with TB0RG1 TB0RG0 (compare value) Register buffer
Up-counter = Q1
Up-counter = Q2 Trigger to shift to TB0RG1
Q1 Q2
Q2 Q3 Write TB0RG0
Fig. 11-8 Register Buffer Operation Note: Double buffering is available for TB0RG0 only. Pay attention to changes to TB0RG1.
TMP19A43(rev2.0) 11-17
16-bit Timer/Event Counters (TMRBs)
TMP19A43
The block diagram of this mode is shown below.
TB0RUN TB0OUT (PPG output) 16-bit up-counter UC0 Clear F/F (TB0FF0)
TB0IN0 T1 T4 T16
Selector
16-bit comparator
Match
16-bit comparator
Selector
TB0RG0
TB0RG0-WR TB0RUN Register buffer 0 TB0RG1
Internal data bus
Fig. 11-9 Block Diagram of 16-bit PPG Mode Each register in the 16-bit PPG output mode must be programmed as listed below.
7 TB0CR TB0RUN TB0RG0L TB0RG0H TB0RG1L TB0RG1H TB0RUN 1 0 * * * * 1 6 0 0 * * * * 0 5 X 0 * * * * 0 4 3 2 1 0 Starts the TMRB0 module. Disables the TB0RG0 double buffering and stops TMRB0. Specifies a duty. (16 bits) Specifies a cycle. (16 bits) Enables the TB0RG0 double buffering. (Changes the duty/cycle when the INTTB0 interrupt is generated) Specifies to trigger TB0FF0 to reverse when a match with TB0RG0 or TB0RG1 is detected, and sets the initial value of TB0FF0 to "0." Designates the prescaler output clock as the input clock, and disables the capture function. Assigns P54 to TB0OUT.
XXXXX 0-0X0 * * * * 0 * * * * - * * * * 0 * * * * X * * * * 0
TB0FFCR
XX 0 - - - 1
0
0
1
1
1
0
TB0MOD P5CR P5FC P5FC2 TB0RUN
0
- - -
1 - - - 0
0
0
1
*
*
0
(** = 01, 10, 11) 1---- 1---- 0---- 0-1X1
Starts TMRB0.
X; Don't care -; no change
TMP19A43(rev2.0) 11-18
16-bit Timer/Event Counters (TMRBs)
TMP19A43
11.4.4
Timer Synchronization Mode
The timers can be started synchronously by using the timer synchronization mode. The synchronization mode can be used for PPG output, for example, for application to driving a motor. TBnCR is used to turn the synchronization mode on/off. ="0": Operates the timers at the timing specified for each channel. ="1": Enables the synchronous output. There are four blocks, TMRB0 through TMRB3, TMRB4 through TMRB7, TMRB8 through TMRBB and TMRBC through TMRBF. If is set to "1," the timers will not start at the timing specified for each channel by setting TBmRUN to "1,1", but the timers in each block will start in synchronization with TMRB0, TMRB4, TMRB8 or TMRBC. *
Note:
For the channels to be output synchronously, set TBmRUN to "1,1" to enable simultaneous start before starting TMRB0, TMRB4, TMRB8 or TMRBC. Set TBnCR to "0" unless the synchronous output mode is selected. When the synchronous output mode is selected, other channels will not start until TMRB0, 4 , 8 and C start.
*
note)MasterTMRB0,TMRB4,TMRB8,TMRBC write TBnSYC"0"
7 TBnEN R/W 0
TMRBn operation 0: Disable 1: Enable
6 R/W 0
Write "0."
5 R 0
This can be read as "0."
4 R 0
This can be read as "0."
3
2
1 R 0
This can be read as "0."
0 R 0
This can be read as "0."
TBnCR (0xFFFF_F1x1)
Bit symbol Read/Write After reset
TBnSYC R R/W 0 0 Write"0" This can
be read as "0."
Function
SlaveWrite TBnSYC "1"
TBnCR (0xFFFF_F1x1)
7
Bit symbol Read/Write After reset TBnEN R/W 0 TMRBn operation 0: Disable 1: Enable
6
R/W 0 Write "0."
5
R 0 This can be read as "0."
4
R 0 This can be read as "0."
3 TBnSYC R/W 0
Write "1"
2 R 0
This can be read as "0."
1 R 0
This can be read as "0."
0 R 0
This can be read as "0."
Function
TMP19A43(rev2.0) 11-19
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Applications using the Capture Function
The capture function can be used to develop many applications, including those described below: One-shot pulse output triggered by an external pulse Frequency measurement Pulse width measurement Time difference measurement One-shot pulse output triggered by an external pulse One-shot pulse output triggered by an external pulse is carried out as follows: The 16-bit up-counter (UC6) is made to count up by putting it in a free-running state using the prescaler output clock. An external pulse is input through the TB6IN0 pin. A trigger is generated at the rising of the external pulse by using the capture function and the value of the up-counter is taken into the capture registers (TB6CP0H/L). The INTC must be programmed so that an interrupt INT0 is generated at the rising of an external trigger pulse. This interrupt is used to set the timer registers (TB6RG0H/L) to the sum of the TB6CP0 value (c) and the delay time (d), (c + d), and set the timer registers (TB6RG1H/L) to the sum of the TB6RG0H/L values and the pulse width (p) of one-shot pulse, (c + d + p). In addition, the timer flip-flop control registers (TB6FFCR) must be set to "11." This enables triggering the timer flip-flop (TB6FF0) to reverse when UC6 matches TB6RG0H/L and TB6RG1H/L. This trigger is disabled by the INTTB6 interrupt after a one-shot pulse is output. Symbols (c), (d) and (p) used in the text correspond to symbols c, d and p in Fig. 11-10 One-shot Pulse Output (With Delay)."
Put the counter in a free-running state Count clock (Internal clock) TB6IN0 pin input (External trigger pulse)
c
c+d
c+d+p
Taking data into the capture register (CAP6) INT0 generation INTTB6 generation
Match with TB6RG0H/L INTTB6 generation Enable reverse
Enable reverse Match with TB6RG1H/L Disable reverse when data is taken into CAP6 Timer output TB6OUT pin Delay time (d) Pulse width (p)
Fig. 11-10 One-shot Pulse Output (With Delay)
TMP19A43(rev2.0) 11-20
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Programming example: Output a 2-ms one-shot pulse triggered by an external pulse from the TB6IN0 pin with a 3-ms delay
* Clock condition System clock : High speed (fc) High-speed clock gear : 1X (fc) Prescaler clock : fperiph/4 (fperiph fsys) Main programming Puts to a free-running state 7 TB6MOD TB6FFCR X X 6 X X 5 1 0 4 0 0 3 1 0 2 0 0 1 0 1 0 Uses T1 for counting. 1 Takes data into TB6CP0 at the rising of TB6IN0 input 0 Clears TB6FF0 to zero Disables TB6FF0 to reverse P9CR P9FC IMC0 -- -- XX XX XX XX XX X X X - - - 0 1 0 0 1 - - 0 1 0 0 1 1 1 1 0 - - 0 0 0 0 0 0 0 0 -
- -
IMC9
0 1 0 0 0 0 0 0 1
- - 0 0 0 0 0 0 0 0 X
1 1 0 0 0 0 0 0 0 0 1
Assigns P90 pin to TB6OUT
Enables INT0 and disables INTTB6 These are 32-bit registers and must be all processed.
TB6RUN
X1 X1 X1 0X
Starts TMRB6
INT0 programming TB6RG0 TB6RG1 TB6FFCR TB0CP0 + 3 ms/T1 TB0RG0 + 2 ms/T1 XX- - 1 1
-
- Enables TB2FF0 to reverse when there is a match with TB2RG0, 1
IMC9

X X X X
X X X X
1 1 1 1
1 1 1 1
0 0 0 0
0 0 0 1
0 0 0 0
0 0 0 0
Enables INTTB6
INTTB6 programming TB6FFCR X X - - 0 0 - - Disables TB6FF0 to reverse when there is a match with TB6RG0, 1 IMC9 X X X X X X X X 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Disables INTTB6
X; Don't care ;no change If a delay is not required, TB6FF0 is reversed when data is taken into TB6CP0, and TB6RG1 is set to the sum of the TB6CPO value (c) and the one-shot pulse width (p), (c + p), by generating the INT0 interrupt. TB6FF0 is enabled to reverse when UC6 matches with TB6RG1, and is disabled by generating the INTTB6 interrupt. TMP19A43(rev2.0) 11-21 16-bit Timer/Event Counters (TMRBs)
TMP19A43
Count clock (Prescaler output clock) c TB6IN0 input (External trigger pulse)
c+p
Taking data into the capture register TB6CP0 INT0 generation
INTTB6 generation Match with TB6RG1 Enable reverse Timer output TB6OUT pin Pulse width Enable reverse when data is taken into TB6CP0 (p)
Taking data into the capture register TB6CP1
Disable reverse when data is taken into TB6CP1
Fig. 11-11 One-shot Pulse Output Triggered by an External Pulse (Without Delay) Frequency measurement By using the capture function, the frequency of an external clock can be measured. To measure frequency, another 16-bit timer (TMRB0) is used in combination with the 16-bit event counter mode (TMRB0 reverses TB0FFCR to specify the measurement time). The TB3IN0 pin input is selected as the TMRB3 count clock to perform the count operation using an external input clock. TB3MOD is set to "11." This setting allows a count value of the 16-bit UC0 up-counter to be taken into the capture register (TB0CP0) upon the rising of a timer flipflop (TB3FFCR) of the 16-bit timer (TMRB3), and an UC0 counter value to be taken into the capture register (TB0CP1) upon the falling of TB3FF of the 16-bit timer (TMRB3). A frequency is then obtained from the difference between TB0CP0 and TB0CP1 based on the measurement, by generating the INTTB3 16-bit timer interrupt.
Count clock (TB3IN0 pin input)
C1
C2
TB0OUT Taking data into TB3CP0 Taking data into TB3CP1
C1 C2 C1 C2
INTTB0
Fig. 11-12 Frequency Measurement For example, if the set width of TB3FF level "1" of the 16-bit timer is 0.5 s and if the difference between TB0CP0 and TB0CP1 is 100, the frequency is 100 / 0.5 s = 200 Hz.
TMP19A43(rev2.0) 11-22
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Pulse width measurement By using the capture function, the "H" level width of an external pulse can be measured. Specifically, an external pulse is input through the TB0IN0 pin and the up-counter (UC6) is made to count up by putting it in a free-running state using the prescaler output clock. A trigger is generated at each rising and falling edge of the external pulse by using the capture function and the value of the up-counter is taken into the capture registers (TB0CP0, TB0CP1). The INTC must be programmed so that INT0 is generated at the falling edge of an external pulse input through the TB6IN0 pin. The "H" level pulse width can be calculated by multiplying the difference between TB6CP0 and TB6CP1 by the clock cycle of an internal clock. For example, if the difference between TB6CP0 and TB6CP1 is 100 and the cycle of the prescaler output clock is 0.5 s, the "H" level pulse width is 100 x 0.5 s = 50 s. Caution must be exercised when measuring pulse widths exceeding the UC2 maximum count time which is dependant upon the source clock used. The measurement of such pulse widths must be made using software.
Prescaler output clock TB6IN0 pin input (External pulse) Taking data into TB6CP0 Taking data into TB6CP1 INT0
C1
C2
C1 C2
C1 C2
Fig. 11-13 Pulse Width Measurement The "L" level width of an external pulse can also be measured. In such cases, the difference between C2 generated the first time and C1 generated the second time is initially obtained by performing the second stage of INT0 interrupt processing as shown in "Fig. 11-14 Time Difference Measurement," and this difference is multiplied by the cycle of the prescaler output clock to obtain the "L" level width.
TMP19A43(rev2.0) 11-23
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Time Difference Measurement By using the capture function, the time difference between two events can be measured. Specifically, the up-counter (UC6) is made to count up by putting it in a free-running state using the prescaler output clock. The value of UC6 is taken into the capture register (TB6CP0) at the rising edge of the TB6IN0 pin input pulse. The INTC must be programmed to generate INT0 interrupt at this time. The value of UC6 is taken into the capture register TB6CP1 at the rising edge of the TB6IN1 pin input pulse. The INTC must be programmed to generate INT1 interrupt at this time. The time difference can be calculated by multiplying the difference between TB6CP1 and TB6CP0 by the clock cycle of an internal clock.
Prescaler output clock C1 TB6IN0 pin input TB6IN1 pin input Taking data into TB6CP0 C2
Taking data into TB6CP1 INT0 INT1 Time difference
Fig. 11-14 Time Difference Measurement
TMP19A43(rev2.0) 11-24
16-bit Timer/Event Counters (TMRBs)
TMP19A43
11.5 Two-phase Pulse Input Count Mode (TMRB2, TMRB3, TMRB6, TMRB7)
(Operations are common to TMRB2, 3, 6 and 7. This section describes TMRB2 only.) In this mode, the counter is incremented or decremented by one depending on the state transition of the twophase clock that is input through TB2IN0 and TB2IN1 and has phase difference. An interrupt is output when a counter overflow or underflow occurs in the up-and-down counter mode, and when the counting operation is executed. Interrupt is output in the ups and downs counter mode by the count operation. There are two counting operation modes, which are switched by the register setting. 1) Normal operation mode (up/down at the fourth count) 2) Quadruple mode (up/down at each count) UC0
Digital noise filter (-Delete 8 clocks) fs or T/4
UP UPINT
+
-
INT
01 13 32 20 TB2CR TB2CR 10 UP
DOWN DOWNNT
SET
INT
(Lead clear)
Internal bus
02 01
SET CLR
20
DOWN
01 02
fs or /4
SET CLR
Fig. 11-15 Count Circuit of Two-phase Counter
TMP19A43(rev2.0) 11-25
16-bit Timer/Event Counters (TMRBs)
TMP19A43
* Normal operation count mode
UP 1 1 0 0 1 DOWN
TB2IN0
1
0
0
1
1
TB2IN1
1 0
0
0
1 1
1 0
1
1
0
0
1
2
3
0
1
3
2
0
Pin state
Count condition TB2IN0, TB2IN1
TB2IN0, TB2IN1 TB2IN0, TB2IN1
UP 0 1 1 0 0 2 2 2 0
DOWN 1 0 0 SET Interrupt generated CLR
Note:
Changes from 0 to 3 and from 3 to 0 are considered as irregular states and are not counted. Up and down state settings are cleared.
* Multiplication-by-4 operation count mode
UP 1 TB2IN0 1 0 0 1 DOWN
1
0
0
1
1
1 TB2IN1 0
0 2
0 3
1 1
1 0
1
1
0
0
1
0
1
3
2
0
Count up at each edge
Count down at each edge
Pin state
Count condition TB2IN0, TB2IN1
0 2 3 1
UP 2 3 1 0 0 1 3 2
DOWN 1 3 2 0
TMP19A43(rev2.0) 11-26
16-bit Timer/Event Counters (TMRBs)
TMP19A43
TMRB2RUN register (TB2RUN)
7
TB2RUN (0xFFFF_F160) bit Symbol Read/Write After reset Function TB2RDE R/W 0 Double Buffering 0: Disable 1: Enable
6
R/W 0 Write "0."
5
UD2CK R/W 0 Select sampling clock 0: fs 1: T0/4
4
TB2UDCE R/W
3
I2TB2 R/W
2
TB2PRUN R/W
1
R
0
TB2RUN R/W 0
0 0 0 0 Enable/ IDLE Timer Run/Stop Control disable 0: Stop 0: Stop & Clear two-phase 1: Operate 1: Run (Count Up) counter 0: Disable 1: Enable
Fig. 11-16 Two-phase Pulse Input Count Mode Setting Register For the sampling clock, the fifth bit of the TB2RUN register is set to "1." << Recovery from the SLEEP mode >> 1) 2) For TMRB2 and TMRB3 The two-phase counter counts up or down depending on the SLEEP release input state. Recovery by using INT0 through INT3 for TMRB6 and TMRB7 The counter value does not change until the requirements are satisfied. To read the counter value after the SLEEP mode is released, it must be executed when an interrupt is generated due to counting up or down. Operation mode Register setting determines whether the external input signals from the TB2IN0 and TB2IN1 input pins are input to the normal 16-bit timer (capture input) or the up-and-down counter. * * * In the up-and-down counter mode, capture is executed by the software only. Capture at the external clock timing does not work. In the up-and-down counter mode, the comparator is disabled and it does not execute comparison with timer registers. The input clock sampling is executed by fs (32 KHz/16KHz) or the high-speed clock (system clock). The maximum input frequency is 4 kHz for fs and T0/4 for the high-speed clock.
<< Recovery from the STOP mode >> Recovery by using INT0 through INT3 for TMRB6 and TMRB7 The two-phase counter enters the STOP mode while it maintains the previous state. Therefore, when the relationship between the input state used for releasing the STOP mode and the maintained state satisfies the requirements for counting up or down, the counter value is incremented or decremented by one (+1 or -1) after the STOP mode is released. If it is necessary to keep a constant state after the STOP mode is released, the two-phase counter must be initialized to "0x7FFF" after the STOP mode is released (by setting TB7RUN to "0" and turning it back to "1"). This function is unavailable for TMRB2 and TMRB3. << How to program the up-and-down counter >> Set the TB2MOD register to "00" (prescaler OFF). Then, program the fourth bit of the TB2RUN register to determine whether to operate the counter as the up-anddown counter or as the conventional up-counter for external clock input. TB2UDCE (Enable the up-and-down counter) = "0": Normal 16-bit timer operation = "1": Up-and-down counter operation
TMP19A43(rev2.0) 11-27
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Interrupt * In the NORMAL or SLOW mode The INTTB2 interrupt is enabled using the interrupt controller (INTC). The INTTB2 interrupt is generated by counting up or down. Reading the status register TB2ST during interrupt handling allows simultaneous check for occurrences of an overflow and an underflow. If TB2ST is "1," it indicates that an overflow has occurred. If is "1," it indicates that an underflow has occurred. This register is cleared after it is read. The counter becomes 0x0000 when an overflow occurs, and it becomes 0xFFFF when an underflow occurs. After that, the counter continues the counting operation.
7
bit Symbol TB2ST (0xFFFF_F164) Read/Write After reset
6
R 0
5
4
INTTBUD2
3
INTTBUDF2
2
INTTBOUF2
1
R 0
0
0
Up-anddown count 0: Not occurred 1: Occurred
R 0
Underflow 0: Not occurred 1: Occurred
0
Overflow 0: Not occurred 1: Occurred
This can be read as "0." Function
This can be read as "0."
Fig. 11-17 TMRB2 Status Register Note: The status is cleared after the register is read.
*
In the SLEEP mode The two-phase input pulse input counter operates. The INTTB2 interrupt is generated by the count-up or count-down input, and the system recovers from the SLEEP mode. Reading the status register TB2ST during interrupt handling allows simultaneous check for occurrences of an overflow and an underflow. If TB2ST is "1," it indicates that an overflow has occurred. If is "1," it indicates that an underflow has occurred. This register is cleared after it is read. The counter becomes 0x0000 when an overflow occurs, it and becomes 0xFFFF when an underflow occurs. After that, the counter continues the counting operation.
*
In the STOP mode (Recovery by using INT0 through INT3 for TMRB6 and TMRB7) The two-phase input pulse input counter is stopped. After the release input and the elapse of warm-up time, the mode changes to the NORMAL mode and the counting operation restarts. When the relationship between the input state used for releasing the STOP mode and the maintained state satisfies the requirements for counting up or down, the counter value is incremented or decremented by one (+1 or -1) after the STOP mode is released.
TMP19A43(rev2.0) 11-28
16-bit Timer/Event Counters (TMRBs)
TMP19A43
Up-and-down counter When the two-phase input count mode is selected (TB2RUN = "1"), the up-counter becomes the up-and-down counter and it is initialized to 0x7FFF. If a counter overflow occurs, the counter returns to 0x0000. If a counter underflow occurs, the counter returns to 0xFFFF. After that, the counter continues the counting operation. Therefore, the state can be checked by reading the counter value and the status flag TB2ST after an interrupt is generated.
Sampling clock
Up-count input 0x3FFF 0x4000 0x4001
Up-and-down counter value
Up-and-down interrupt
(Note 1) The up (down) count input must be set to the "H" level for the states before and after an input. (Note 2) Reading of counter value must be executed during INTTB2 interrupt handling
TMRB2 control register
TB2CR (0xFFFF_F162)
7
bit Symbol Read/Write After reset TB2EN R/W 0 TMRB2 operation 0: Disable 1: Enable
6
R/W 0 Write "0."
5
4
3
TB2SYC
2
UD2NF
1
UD2CNT R/W 0
0
Function
R R R/W R/W 0 0 0 0 This can be This can be Synchronization Digital noise filter read as "0." read as "0." mode switchover 0: No use 0: Individual 1: Use operation
1: Synchronous operation
R 0 Mode switch- This can be over read as "0."
0: Normal 1: Quadruple
* Mode switch-over bit
0: Normal mode 1: Quadruple mode UD2NF Controls noise removal. If this is set to "1 (Use)," the TMRB2, TMRB3, TMRB6 and TMRB7 pin inputs are removed when they are shorter than 8 system clocks. Pay close attention to the input signal frequency because an error of one system clock occurs due to synchronization with internal signals.
TMP19A43(rev2.0) 11-29
16-bit Timer/Event Counters (TMRBs)
TMP19A43
12. 32-bit Input Capture (TMRC)
TMRC consists of one channel with a 32-bit time base timer (TBT), four channels (TCCAP0 through TCCAP3) each with a 32-bit input capture register, and eight channels (TCCMP0 through TCCMP7) each with a 32-bit compare register. Fig. 12-1 shows the TMRC block diagram.
12.1 TMRC Block Diagram
Prescaler input clock (T0)
4
T2
8
T4
16
T8
32
T16
64
T32
128 256 512
T64 T128 T256
RUN & Clear
Clear & count control circuit
TBTIN (PC0)
Noise removal circuit 32-bit time base timer (TBT)
Overflow interrupt (INTTBT)
Prescaler output T2 through T256
Capture registers 0 through 3 (TCCAP0 through TCCAP3)
TC0IN (P32)
Noise removal circuit
Edge detection
32-bit input capture (TCCAP0)
Capture 0 interrupt (INTCAP0)
Compare registers 0 through 7 (TCCMP0 through TCCMP7) 32-bit comparator Compare match interrupt 0 (INTCMP0) (INTCAPA) Compare match trigger (CMP0TRG) Compare match output (TCOUT0)
32-bit register buffer 0
32-bit compare register 0 (TCCMP0)
Fig. 12-1 Timer C Block Diagram
TMP19A43 (rev2.0) 12-1
32-bit Input Capture (TMRC)
TMP19A43
12.2 Description for Operations of Each Circuit
12.2.1 Prescaler
The prescaler is provided to acquire the TMRC source clock. The prescaler input clock T0 is fperiph/2, fperiph/4, fperiph/8 or fperiph/16 selected by SYSCR0 in the CG. T2 through T256 generated by dividing T0 are available as TMRC prescaler input clocks and can be selected with TBTCR. Fperiph is either "fgear" which is a clock selected by SYSCR1 in the CG, or "fc" which is a clock before it is divided by the clock gear. The operation or stoppage of the prescaler is set with TBTRUN where writing "1" starts counting and writing "0" clears and stops counting. Table 12-1 shows the prescaler output clock resolutions.
TMP19A43 (rev2.0) 12-2
32-bit Input Capture (TMRC)
TMP19A43
Table 12-1 Prescaler Output Clock Resolutions
@fc = 40.0MHz Select peripheral clock 0(fgear) Clock gear Select prescaler value clock

Prescaler output clock resolution
T2 000(fc) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 100(fc/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 110(fc/4) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 111(fc/8) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 1(fc) 000(fc) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 100 (fc/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 110(fc/4) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 111(fc/8) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) fc/2 (1.60s) fc/2 (0.80s) fc/2 (0.40s) fc/23(0.20s) fc/27(3.20s) fc/26(1.60s) fc/2 (0.80s) fc/24(0.40s) fc/28(6.40s) fc/2 (3.20s) fc/26(1.60s) fc/25(0.80s) fc/29(12.8s) fc/2 (6.40s) fc/27(3.20s) fc/26(1.60s) fc/26(1.60s) fc/2 (0.80s) fc/24(0.40s) fc/23(0.20s) fc/26(1.60s) fc/2 (0.80s) fc/24(0.40s) fc/23(0.20s) fc/26(1.60s) fc/2 (0.80s) fc/24(0.40s) fc/23(0.20s) fc/26(1.60s) fc/2 (0.80s) fc/2 (0.40s) fc/23(0.20s)
4 5 5 5 5 8 7 5 4 5 6 7 6 5
T4 fc/2 (3.20s) fc/2 (1.60s) fc/2 (0.80s) fc/24(0.40s) fc/28(6.40s) fc/27(3.20s) fc/2 (1.60s) fc/25(0.80s) fc/29(12.8s) fc/2 (6.40s) fc/27(3.20s) fc/26(1.60s) fc/210(25.6s) fc/2 (12.8s) fc/28(6.40s) fc/27(3.20s) fc/27(3.20s) fc/2 (1.60s) fc/25(0.80s) fc/24(0.40s) fc/27(3.20s) fc/2 (1.60s) fc/25(0.80s) fc/24(0.40s) fc/27(3.20s) fc/2 (1.60s) fc/25(0.80s) fc/24(0.40s) fc/27(3.20s) fc/2 (1.60s) fc/2 (0.80s) fc/24(0.40s)
5 6 6 6 6 9 8 6 8 7 6
T8 fc/2 (6.40s) fc/2 (3.20s) fc/2 (1.60s) fc/25(0.80s) fc/29(12.8s) fc/28(6.40s) fc/2 (3.20s) fc/26(1.60s) fc/210(25.6s) fc/2 (12.8s) fc/28(6.40s) fc/27(3.20s) fc/211(51.2s) fc/2 (25.6s) fc/29(12.8s) fc/28(6.40s) fc/28(6.40s) fc/2 (3.20s) fc/26(1.60s) fc/25(0.80s) fc/28(6.40s) fc/2 (3.20s) fc/26(1.60s) fc/25(0.80s) fc/28(6.40s) fc/2 (3.20s) fc/26(1.60s) fc/25(0.80s) fc/28(6.40s) fc/2 (3.20s) fc/2 (1.60s) fc/25(0.80s)
6 7 7 7 7 10 9 7 9
T16 fc/2 (12.8s) fc/28(6.40s) fc/27(3.20s) fc/26(1.60s) fc/210(25.3s) fc/29(12.6s) fc/28(6.32s) fc/27(3.20s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/26(1.60s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/26(1.60s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/26(1.60s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/26(1.60s)
TMP19A43 (rev2.0) 12-3
32-bit Input Capture (TMRC)
TMP19A43
@fc = 40MHz Select peripheral clock 0(fgear) Clock gear Select prescaler value clock

Prescaler output clock resolution
T32 000(fc) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) fc/2 (25.6s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s)
10 11
T64 fc/2 (51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/214(409.6s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s)
12
T128 fc/2 (102.4s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/214(409.6s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/215(819.2s) fc/214(409.6s) fc/213(204.8s) fc/212(102.4s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/26(1.60s) fc/25(0.80s)
13
T256 fc/2 (204.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/214(409.6s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/215(819.2s) fc/214(409.6s) fc/213(204.8s) fc/212(102.4s) fc/216(1638.4s) fc/215(819.2s) fc/214(409.6s) fc/213(204.8s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/213(204.8s) fc/212(102.4s) fc/211(51.2s) fc/210(25.6s) fc/29(12.8s) fc/28(6.40s) fc/27(3.20s) fc/26(1.60s)
100(fc/2)
110(fc/4)
111(fc/8)
1(fc)
000(fc)
100(fc/2)
110(fc/4)
111 (fc/8)
(Note 1) Do not change the clock gear while the timer is operating. (Note 2) "-" denotes "setting prohibited."
TMP19A43 (rev2.0) 12-4
32-bit Input Capture (TMRC)
TMP19A43
12.2.2
Noise Removal Circuit
The noise removal circuit removes noises from an external clock source input (TBTIN) and a capture trigger input (TcnIN) of the time base timer (TBT). It can also output input signals without removing noises from them.
12.2.3
32-bit Time Base Timer (TBT)
This is a 32-bit binary counter that counts up upon the rising of an input clock specified by the TBT control register TBTCR of the time base timer. Based on the TBTCR setting, an input clock is selected from external clocks supplied through the TBTIN pin and eight prescaler output clocks T2, T4, T8, T16, T32, T64, T128, and T256. "Count," "stop" or "clear" of the up-counter can be selected with TBTRUN. When a reset is performed, the up-counter is in a cleared state and the timer is in an idle state. As counting starts, the up-counter operates in a free-running condition. As it reaches an overflow state, the overflow interrupt INTTBT is generated; subsequently, the count value is cleared to 0 and the up-counter restarts a countup operation. This counter can perform a read capture operation. When it is performing a read capture operation, it is possible to read a counter value by accessing the TBT read capture register (TBTRDCAP) in units of 32 bits. However, a counter value cannot be read (captured) if the register is accessed in units of 8 or 16 bits.
12.2.4
Edge Detection Circuit
By performing sampling, this circuit detects the input edge of an external capture input (TcnIN). It can be set to "rising edge," "falling edge," "both edges" or "not capture" by provisioning the capture control register CAPnCR. Fig. 13.2 shows capture inputs, outputs (capture factor outputs) produced by the edge detection circuit, and specific detection circuit settings.
TCnIN input
Capture factor (Rising edge setting) (Falling edge setting)
(Both-edge setting)
(Not capture setting)
Fig. 12-2 Capture Inputs and Capture Factor Outputs (Outputs Produced by the Edge Detection Circuit)
TMP19A43 (rev2.0) 12-5
32-bit Input Capture (TMRC)
TMP19A43
12.2.5
32-bit Capture Register
This is a 32-bit register for capturing count values of the time base timer by using capture factors as triggers. If a capture operation is performed, the capture interrupt INTCAPn is generated. Four interrupt requests INTCAP0 through INTCAP3 are grouped into one set of interrupt requests which are then notified to the interrupt controller. Which one of interrupt requests INTCAP0 through INTCAP3 must be processed can be identified by reading the status register TCG0ST during interrupt processing. Additionally, it is possible to mask unnecessary interrupts by setting the interrupt mask register TCG0IM to an appropriate bit setting. While a read of the capture register is ongoing, count values cannot be captured even if there are triggers. Data is read in the order of lower to higher bits by using a word transfer instruction. If a half-word transfer instruction is used, data is read twice. If a byte data transfer instruction is used, data is read four times.
12.2.6
32-bit Compare Register
This is a 32-bit register for specifying a compare value. TMRC has eight built-in compare registers, TCCMP0 through TCCMP7. If values set in these compare registers match the value of the time base timer TBT, the match detection signal of a comparator becomes active. "Compare enable" or "compare disable" can be specified with the compare control register CMPCTL. To set TCCMPn to a specific value, data must be transferred to TCCMPn in the order of lower to higher bits by using a word transfer instruction. If a half-word transfer instruction is used, data is transferred twice to TCCMPn. If a byte data transfer instruction is used, data is transferred four times to TCCMPn. Each compare register has a double-buffer structure, that is, TCCMPn forms a pair with a register buffer "n." "Enable" or "disable" of the double buffers is controlled by the compare control register CMPCTL . If is set to "0," the double buffers are disabled. If is set to "1," they are enabled. If the double buffers are enabled, data transfer from the register buffer "n" to the compare register TCCMPn takes place when the value of TBT matches that of TCCMPn. Because TCCMPn is indeterminate when a reset is performed, it is necessary to prepare and write data in advance. A reset initializes CMPCTL to "0" and disables the double buffers. To use the double buffers, data must be written to the compare register, must be set to "1," and then the following data must be written to the register buffer. TCCMPn and the register buffer are assigned to the same address. If is "0," the same value is written to TCCMPn and each register buffer. If is "1," data is written to each register buffer only. Therefore, to write an initial value to the compare register, it is necessary to set the double buffers to "disable."
TMP19A43 (rev2.0) 12-6
32-bit Input Capture (TMRC)
TMP19A43
12.3 Register Description
TMRC Control Register 7
TCCR (0xFFFF_F400) bit Symbol Read/Write After reset 0
TMRC operation
6
I2TBT R/W 0 IDLE 0: Stop 1: Run
5
4
3
R 0
2
1
0
TCEN
"0" is read.
Function
0: Disable 1: Enable
: :
Controls the operation in IDLE mode Specifies enabling/disabling of the TMRC operation. If set to "disable," a clock is not supplied to other registers of the TMRC module and, therefore, a reduction in power consumption is possible (a read of or a write to other registers cannot be executed). To use TMRC, the TMRC operation must be set to "enable" ("1") before making individual register settings of TMRC modules. If TMRC is operated and then set to "disable," individual register settings are retained.
TBTRUN Register 7
TBTRUN (0xFFFF_F401)
bit Symbol
6
R 0
5
4
3
2
TBTCAP
1
TBTPRUN
0
TBTRUN
Read/Write After reset "0" is read. Function
R/W 0 0 0 TimerRun/Stop Control 0: Stop & clear 1: Count 0 Ensure this is TBT counter software set to "0." capture 0: Don't Care 1: Software capture
: Controls the TBT count operation : Controls the TBT prescaler operation : If this is set to "1," the count value of the time base timer (TBT) is taken into the capture register TBTCAPn.
Fig. 12-3 TMRC-related Registers
TMP19A43 (rev2.0) 12-7
32-bit Input Capture (TMRC)
TMP19A43
TBT Control Register 7
TBTCR bit Symbol (0xFFFF_F402) Read/Write After reset TBTNF 0
TBTIN Input noise removal
6
5
4
R/W
3
TBTCLK3
2
TBTCLK2 0
1
TBTCLK1 0
0
TBTCLK0 0
0
0
0
0
TBT source clock
Ensure this is set to "0."
Function
0:2/fsys or more 1:6/fsys or more
0000: T2 0001: T4 0010: T8 0011: T16 0100: T32 0101: T64 0110: T128 0111: T256 1111: TBTIN pin input
: This is an input clock for TBT. Clocks from "0000" to "0111" are available as prescaler output clocks. A clock "1111" is input through the TBTIN pin. : Controls the noise removal for the TBTIN pin input. If this is set to "0" (removal disabled), any input of more than 2/fsys (50ns@fperiph=fc=40MHz) is accepted as a source clock for TBT, at whichever level the TBTIN pin is, "H" or "L." If this is set to "1" (removal enabled), any input of less than 6/fsys (150ns@fperiph=fc=40MHz) is regarded as noise and removed, at whichever level the TBTIN pin is, "H" or "L." The range of removal changes depending on the selected clock gear and a system clock used.
TBT Capture Register (TBTCAP) 7
TBTCAP0 (0xFFFF_F404) bit Symbol Read/Write After reset Function TBTCAP1 (0xFFFF_F405) bit Symbol Read/Write After reset Function TBTCAP2 (0xFFFF_F406) bit Symbol Read/Write After reset Function TBTCAP3 (0xFFFF_F407) bit Symbol Read/Write After reset Function Capture data Capture data Capture data Capture data CAP07
6
CAP06
5
CAP05
4
CAP04 R
3
CAP03
2
CAP02
1
CAP01
0
CAP00
7
CAP15
6
CAP14
5
CAP13
4
CAP12 R
3
CAP11
2
CAP10
1
CAP09
0
CAP08
7
CAP23
6
CAP22
5
CAP21
4
CAP20 R
3
CAP19
2
CAP18
1
CAP17
0
CAP16
7
CAP31
6
CAP30
5
CAP29
4
CAP28 R
3
CAP27
2
CAP26
1
CAP25
0
CAP24
Fig. 12-4 TMRC-related Registers
TMP19A43 (rev2.0) 12-8
32-bit Input Capture (TMRC)
TMP19A43
TBT Read Capture Register (TBTRDCAP) 7
TBTRDCAPLL (0xFFFF_F408) bit Symbol Read/Write After reset Function TBTRDCAPLH (0xFFFF_F409) bit Symbol Read/Write After reset Function TBTRDCAPHL (0xFFFF_F40A) bit Symbol Read/Write After reset Function TBTRDCAPHH (0xFFFF_F40B) bit Symbol Read/Write After reset Function Capture data Capture data Capture data Capture data
6
5
4
R
3
2
1
0
RDCAP07 RDCAP06 RDCAP05 RDCAP04 RDCAP03 RDCAP02 RDCAP01 RDCAP00
7
6
5
4
R
3
2
1
0
RDCAP15 RDCAP14 RDCAP13 RDCAP12 RDCAP11 RDCAP10 RDCAP09 RDCAP08
7
6
5
4
R
3
2
1
0
RDCAP23 RDCAP22 RDCAP21 RDCAP20 RDCAP19 RDCAP18 RDCAP17 RDCAP16
7
6
5
4
R
3
2
1
0
RDCAP31 RDCAP30 RDCAP29 RDCAP28 RDCAP27 RDCAP26 RDCAP25 RDCAP24
Fig. 12-5 TMRC-related Registers
TMP19A43 (rev2.0) 12-9
32-bit Input Capture (TMRC)
TMP19A43
TMRC Capture 0 Control Register 7
CAP0CR (0xFFFF_F410) bit Symbol Read/Write After reset TC0NF R/W 0
TC0IN Input noise removal
6
5
4
R 0
3
2
1
CP0EG1 R/W 0
00Not capture 01Rising edge 10Falling edge 11Both edges
0
CP0EG0 0
"0" is read.
Select effective edge of TC0IN input
Function
0:2/fsys or more 1:6/fsys or more
: :
Selects the effective edge of an input to the trigger input pin TC0IN of the capture 0 register (TCCAP0). If this is set to "00," the capture operation is disabled. Controls the noise removal for the TC0IN pin input. If this is set to "0" (removal disabled), any input of more than 2/fsys (50ns@fperiph=fc=40MHz) is accepted as a trigger input for TCCAP0, at whichever level the TC0IN pin is, "H" or "L." If this is set to "1" (removal enabled), any input of less than 6/fsys (150ns@fperiph=fc=40MHz) is regarded as noise and removed, at whichever level the TC0IN pin is, "H" or "L." The range of removal changes depending on the selected clock gear and a system clock used.
Fig. 12-6 TMRC-related Registers
TMP19A43 (rev2.0) 12-10
32-bit Input Capture (TMRC)
TMP19A43
TMRC Capture 0 Register (TCCAP0) 7
TCCAP0LL (0xFFFF_F414) bit Symbol Read/Write After reset Function TCCAP0LH (0xFFFF_F415) Capture 0 data CAP007
6
CAP006
5
CAP005
4
CAP004 R
3
CAP003
2
CAP002
1
CAP001
CAP000
7
bit Symbol Read/Write After reset Function TCCAP0HL (0xFFFF_F416) Capture 0 data CAP015
6
CAP014
5
CAP013
4
CAP012 R
3
CAP011
2
CAP010
1
CAP009
CAP008
7
bit Symbol Read/Write After reset Function TCCAP0HH (0xFFFF_F417) Capture 0 data CAP023
6
CAP022
5
CAP021
4
CAP020 R
3
CAP019
2
CAP018
1
CAP017
CAP016
7
bit Symbol Read/Write After reset Function Capture 0 data CAP031
6
CAP030
5
CAP029
4
CAP028 R
3
CAP027
2
CAP026
1
CAP025
CAP024
(Note 1) After a reset, the value of TCCAP0 is undefined. (Note 2) Data is not captured during a read of the capture register.
TMRCG0 Interrupt Mask Register 7
TCG0IM (0xFFFF_F40C)
bit Symbol
6
R 0
5
4
3
TCIM3
2
TCIM2
1
TCIM1
0
TCIM0
Read/Write After reset Function "0" is read.
R/W 0
Mask INTCAP3 1: Mask INTCAP2
0
1: Mask
0
1: Mask INTCAP1
0
1: INTCAP0
TMRCG0 Status Register 7
TCG0ST (0xFFFF_F40D)
6
5
4
3
INTCAP3
R
2
INTCAP2
0
0: Interrupt not generated 1: Interrupt generated
1
INTCAP1
0
0: Interrupt not generated 1: Interrupt generated
0
INTCAP0
0
0: Interrupt not generated 1: Interrupt generated
bit Symbol
Read/Write
After reset
"0" is read. Function
0
0
0: Interrupt not generated 1: Interrupt generated
(Note 1) If TCG0ST is read, bits 0, 1, 2 and 3 are cleared.
Fig. 12-7 TMRC-related Registers
TMP19A43 (rev2.0) 12-11
32-bit Input Capture (TMRC)
TMP19A43
TMRC Capture 1 Control Register 7
CAP1CR (0xFFFF_F418) bit Symbol Read/Write After reset TC1NF R/W 0
TC1IN Input noise removal
6
5
4
R 0
3
2
1
CP1EG1 R/W 0
Select effective edge of TC1IN input 00: Not capture 01: Rising edge 10: Falling edge 11: Both edges
0
CP1EG0 0
"0" is read.
Function
0:2/fsys or more 1:6/fsys or more
: :
Selects the effective edge of an input to the trigger input pin TC1IN of the capture 1 register (TCCAP1). If this is set to "00," the capture operation is disabled. Controls the noise removal for the TC1NF pin input. If this is set to "0" (removal disabled), any input of more than 2/fsys (50ns@fperiph=fc=40MHz) is accepted as a trigger input for TCCAP1, at whichever level TC1IN pin is, "H" or "L." If this is set to "1" (removal enabled), any input of less than 6/fsys (150ns@fperiph=fc=40MHz) is regarded as noise and removed, at whichever level the TC1IN pin is, "H" or "L." The range of removal changes depending on the selected clock gear and a system clock used.
TMRC Capture 1 Register (TCCAP1) 7 6
CAP106
5
CAP105
4
CAP104 R
3
CAP103
2
CAP102
1
CAP101
0
CAP100
TCCAP1LL (0xFFFF_F41C)
bit Symbol Read/Write After reset Function
CAP107
Capture 1 data
7
TCCAP1LH (0xFFFF_F41D) bit Symbol Read/Write After reset Function TCCAP1HL (0xFFFF_F41E) bit Symbol Read/Write After reset Function TCCAP1HH (0xFFFF_F41F) bit Symbol Read/Write After reset Function Capture 1 data Capture 1 data Capture 1 data CAP115
6
CAP114
5
CAP113
4
CAP112 R
3
CAP111
2
CAP110
1
CAP109
0
CAP108
7
CAP123
6
CAP122
5
CAP121
4
CAP120 R
3
CAP119
2
CAP118
1
CAP117
0
CAP116
7
CAP131
6
CAP130
5
CAP129
4
CAP128 R
3
CAP127
2
CAP126
1
CAP125
0
CAP124
(Note 1) After a reset, the value of TCCAP1 is undefined. (Note 2) Data is not captured during a read of the capture register.
Fig. 12-8 TMRC-related Registers
TMP19A43 (rev2.0) 12-12
32-bit Input Capture (TMRC)
TMP19A43
TMRC Capture 2 Control Register 7
CAP2CR bit Symbol (0xFFFF_F420) Read/Write After reset TC2NF R/W 0
TC2IN Input noise
6
5
4
R 0
3
2
1
CP2EG1 R/W 0
Select effective edge of TC2IN input 00: Not capture 01: Rising edge 10: Falling edge 11: Both edges
0
CP2EG0 0
"0" is read.
Function
removal 0: Disable 1: Enable
: Selects the effective edge of an input to the trigger input pin TC2IN of the capture 2 register (TCCAP2). If this is set to "00," the capture operation is disabled. : Controls the noise removal for the TC2IN pin input. If this is set to "0" (removal disabled), any input of more than 2/fsys (50ns@fperiph=fc=40MHz) is accepted as a trigger input for TCCAP2, at whichever level the TC2IN pin is, "H" or "L." If this is set to "1" (removal enabled), any input of less than 6/fsys (150ns@fperiph=fc=40MHz) is regarded as noise and removed, at whichever level the TC2IN pin is, "H" or "L." The range of removal changes depending on the selected clock gear and a system clock used.
TMRC Capture 2 Register (TCCAP2) 7
TCCAP2LL (0xFFFF_F424) bit Symbol Read/Write After reset Function TCCAP2LH (0xFFFF_F425) bit Symbol Read/Write After reset Function TCCAP2HL (0xFFFF_F426) bit Symbol Read/Write After reset Function TCCAP2HH (0xFFFF_F427) bit Symbol Read/Write After reset Function Capture 2 data Capture 2 data Capture 2 data Capture 2 data CAP207
6
CAP206
5
CAP205
4
CAP204 R
3
CAP203
2
CAP202
1
CAP201
0
CAP200
7
CAP215
6
CAP214
5
CAP213
4
CAP212 R
3
CAP211
2
CAP210
1
CAP209
0
CAP208
7
CAP223
6
CAP222
5
CAP221
4
CAP220 R
3
CAP219
2
CAP218
1
CAP217
0
CAP216
7
CAP231
6
CAP230
5
CAP229
4
CAP228 R
3
CAP227
2
CAP226
1
CAP225
0
CAP224
(Note 1) After a reset, the value of TCCAP2 is undefined. (Note 2) Data is not captured during a read of the capture register.
Fig. 12-9 TMRC-related Registers
TMP19A43 (rev2.0) 12-13
32-bit Input Capture (TMRC)
TMP19A43
TMRC Capture 3 Control Register 7
CAP3CR (0xFFFF_F428)
bit Symbol TC3NF
6
5
4
R
0
3
2
1
CP3EG1
0
CP3EG0
Read/Write
After reset
R/W
0
TC3IN Input noise
R/W
0
Select effective edge of TC3IN input 00: Not capture 01: Rising edge 10: Falling edge 11: Both edges
0
"0" is read.
Function
removal 0: Disable 1: Enable
: Selects the effective edge of an input to the trigger input pin TC3IN of the capture 3 register (TCCAP3). If this is set to "00," the capture operation is disabled. : Controls the noise removal for the TC3IN pin input. If this is set to "0" (removal disabled), any input of more than 2/fsys (50ns@fperiph=fc=40MHz) is accepted as a trigger input for TCCAP3, at whichever level the TC3IN pin is, "H" or "L." If this is set to "1" (removal enabled), any input of less than 6/fsys (150ns@fperiph=fc=40MHz) is regarded as noise and removed, at whichever level the TC3IN pin is, "H" or "L." The range of removal changes depending on the selected clock gear and a system clock used.
(Note)
Values read from bits 2 through 6 of CAP3CR are all "0."
TMRC Capture 3 Register (TCCAP3) 7 6
CAP306
5
CAP305
4
CAP304
R
3
CAP303
2
CAP302
1
CAP301
0
CAP300
TCCAP3LL (0xFFFF_F42C)
bit Symbol
Read/Write
After reset
Function
CAP307
Capture 3 data
7
TCCAP3LH (0xFFFF_F42D)
6
CAP314
5
CAP313
4
CAP312
R
3
CAP311
2
CAP310
1
CAP309
0
CAP308
bit Symbol
Read/Write
After reset
Function
CAP315
Capture 3 data
7
TCCAP3HL (0xFFFF_F42E)
6
CAP322
5
CAP321
4
CAP320
R
3
CAP319
2
CAP318
1
CAP317
0
CAP316
bit Symbol
Read/Write
After reset
Function
CAP323
Capture 3 data
7
TCCAP3HH (0xFFFF_F42F)
6
CAP330
5
CAP329
4
CAP328
R
3
CAP327
2
CAP326
1
CAP325
0
CAP324
bit Symbol
Read/Write
After reset
Function
CAP331
Capture 3 data
(Note 1) After a reset, the value of TCCAP3 is undefined. (Note 2) Data is not captured during a read of the capture register.
Fig. 12-10 TMRC-related Registers
TMP19A43 (rev2.0) 12-14
32-bit Input Capture (TMRC)
TMP19A43
TMRC Compare Control Register (CMPCTL) 7
CMPCTL0 (0xFFFF_F470)
bit Symbol
6
TCFFEN0
5
TCFFC01
4
TCFFC00
3
R
2
1
CMPRDE0
0
CMPEN0
Read/Write After reset
R 0
R/W 0
reversal
R/W 1
TCFF0 control 00: Reversal 01: Set 10: Clear 11: Don't care
R/W 0
Double buffers 0 0: Disable 1: Enable
1 "0" is read.
0
0
Compare 0 enable 0: Disable 1: Enable
"0" is read. TCFF0 Function
0: Disable 1: Enable
7
CMPCTL1 (0xFFFF_F471)
bit Symbol
6
TCFFEN1
5
TCFFC11
4
TCFFC10
3
R
2
1
CMPRDE1
0
CMPEN1
Read/Write
After reset
R
0
R/W
0
reversal
R/W
1
TCFF1 control 00: Reversal 01: Set 10: Clear 11: Don't care
R/W
0
Double buffers 1 0: Disable 1: Enable
1
"0" is read.
0
0
Compare 1 enable 0: Disable 1: Enable
"0" is read. TCFF1 Function
0: Disable 1: Enable
7
CMPCTL2 (0xFFFF_F472)
bit Symbol
6
TCFFEN2
5
TCFFC21
4
TCFFC20
3
R
2
1
CMPRDE2
0
CMPEN2
Read/Write
After reset
R
0
R/W
0
reversal
R/W
1
TCFF2 control 00: Reversal 01: Set 10: Clear 11: Don't care
R/W
0
Double buffers 2 0: Disable 1: Enable
1
"0" is read.
0
0
Compare 2 enable 0: Disable 1: Enable
"0" is read. TCFF2 Function
0: Disable 1: Enable
7
CMPCTL3 (0xFFFF_F473)
bit Symbol
6
TCFFEN3
5
TCFFC31
4
TCFFC30
3
R
2
1
CMPRDE3
0
CMPEN3
Read/Write
After reset
R
0
R/W
0
reversal
R/W
1
TCFF3 control 00: Reversal 01: Set 10: Clear 11: Don't care
R/W
0
Double buffers 3 0: Disable 1: Enable
1
"0" is read.
0
0
Compare 3 enable 0: Disable 1: Enable
"0" is read. TCFF3 Function
0: Disable 1: Enable
Fig. 12-11 TMRC-related Registers
TMP19A43 (rev2.0) 12-15
32-bit Input Capture (TMRC)
TMP19A43
TMRC Compare Control Register (CMPCTL) 7
CMPCTL4 (0xFFFF_F474)
bit Symbol
6
TCFFEN4
5
TCFFC41
4
TCFFC40
3
R
2
1
CMPRDE4
0
CMPEN4
Read/Write After reset
R 0
R/W 0
reversal
R/W 1
TCFF4 control 00: Reversal 01: Set 10: Clear 11: Don't care
R/W 0
Double buffers 4 0: Disable 1: Enable
1 "0" is read.
0
0
Compare 4 enable 0: Disable 1: Enable
"0" is read. TCFF4 Function
0: Disable 1: Enable
7
CMPCTL5 (0xFFFF_F475)
bit Symbol
6
TCFFEN5
5
TCFFC51
4
TCFFC50
3
R
2
1
CMPRDE5
0
CMPEN5
Read/Write After reset
R 0
R/W 0
reversal
R/W 1
TCFF5 control 00: Reversal 01: Set 10: Clear 11: Don't care
R/W 0
Double buffers 5 0: Disable 1: Enable
1 "0" is read.
0
0
Compare 5 enable 0: Disable 1: Enable
"0" is read. TCFF5 Function
0: Disable 1: Enable
7
CMPCTL6 (0xFFFF_F476)
bit Symbol
6
TCFFEN6
5
TCFFC61
4
TCFFC60
3
R
2
1
CMPRDE6
0
CMPEN6
Read/Write After reset
R 0
R/W 0
reversal
R/W 1
TCFF6 control 00: Reversal 01: Set 10: Clear 11: Don't care
R/W 0
Double buffers 6 0: Disable 1: Enable
1 "0" is read.
0
0
Compare 6 enable 0: Disable 1: Enable
"0" is read. TCFF6 Function
0: Disable 1: Enable
7
CMPCTL7 (0xFFFF_F477)
bit Symbol
6
TCFFEN7
5
TCFFC71
4
TCFFC70
3
R
2
1
CMPRDE7
0
CMPEN7
Read/Write After reset
R 0
R/W 0
reversal
R/W 1
TCFF7 control 00: Reversal 01: Set 10: Clear 11: Don't care
R/W 0
Double buffers 7 0: Disable 1: Enable
1 "0" is read.
0
0
Compare 7 enable 0: Disable 1: Enable
"0" is read. TCFF7 Function
0: Disable 1: Enable
: : :
Controls enabling/disabling of the compare match detection. Controls enabling/disabling of double buffers of the compare register. Controls enabling/disabling of F/F reversal of the compare match output.
: Controls F/F of the compare match output.
Fig. 12-12 TMRC-related Registers
TMP19A43 (rev2.0) 12-16
32-bit Input Capture (TMRC)
TMP19A43
TMRC Compare Register 0 (TCCMP0) 7
TCCMP0LL (0xFFFF_F440) bit Symbol Read/Write After reset Function TCCMP0LH (0xFFFF_F441) bit Symbol Read/Write After reset Function TCCMP0HL (0xFFFF_F442) bit Symbol Read/Write After reset Function TCCMP0HH (0xFFFF_F443) bit Symbol Read/Write After reset Function 0 0 0 0 Compare register 0 data 0 0 0 0 Compare register 0 data 0 0 0 0 Compare register 0 data 0 0 0 0 Compare register 0 data CMP007
6
CMP006
5
CMP005
4
CMP004 R/W
3
CMP003 0
2
CMP002 0
1
CMP001 0
0
CMP000 0
7
CMP015
6
CMP014
5
CMP013
4
CMP012 R/W
3
CMP011 0
2
CMP010 0
1
CMP009 0
0
CMP008 0
7
CMP023
6
CMP022
5
CMP021
4
CMP020 R/W
3
CMP019 0
2
CMP018 0
1
CMP017 0
0
CMP016 0
7
CMP031
6
CMP030
5
CMP029
4
CMP028 R/W
3
CMP027 0
2
CMP026 0
1
CMP025 0
0
CMP024 0
TMRC Compare Register 1 (TCCMP1) 7
TCCMP1LL (0xFFFF_F444)
6
CMP106 0
5
CMP105 0
4
CMP104 0 R/W
3
CMP103 0
2
CMP102 0
1
CMP101 0
0
CMP100 0
bit Symbol Read/Write After reset Function
CMP107 0
Compare register 1 data
7
TCCMP1LH (0xFFFF_F445)
6
CMP114 0
5
CMP113 0
4
CMP112 0 R/W
3
CMP111 0
2
CMP110 0
1
CMP109 0
0
CMP108 0
bit Symbol Read/Write After reset Function
CMP115 0
Compare register 1 data
7
TCCMP1HL (0xFFFF_F446)
6
CMP122 0
5
CMP121 0
4
CMP120 0 R/W
3
CMP119 0
2
CMP118 0
1
CMP117 0
0
CMP116 0
bit Symbol Read/Write After reset Function
CMP123 0
Compare register 1 data
7
TCCMP1HH (0xFFFF_F447)
6
CMP130
0
5
CMP129
0
4
CMP128
0
3
CMP127
0
2
CMP126
0
1
CMP125
0
0
CMP124
0
bit Symbol
Read/Write
After reset
Function
CMP131
0
R/W
Compare register 1 data
Fig. 12-13 TMRC-related Registers
TMP19A43 (rev2.0) 12-17
32-bit Input Capture (TMRC)
TMP19A43
TMRC Compare Register 2 (TCCMP2) 7
TCCMP2LL (0xFFFF_F448) bit Symbol Read/Write After reset Function TCCMP2LH (0xFFFF_F449) bit Symbol Read/Write After reset Function TCCMP2HL bit Symbol (0xFFFF_F44A) Read/Write After reset Function TCCMP2HH bit Symbol (0xFFFF_F44B) Read/Write After reset Function 0 0 0 0 Compare register 2 data 0 0 0 0 Compare register 2 data CMP207
6
CMP206
5
CMP205
4
CMP204 R/W
3
CMP203 0
2
CMP202 0
1
CMP201 0
0
CMP200 0
7
CMP215
6
CMP214
5
CMP213
4
CMP212 R/W
3
CMP211 0
2
CMP210 0
1
CMP209 0
0
CMP208 0
7
CMP223 0
6
CMP222 0
5
CMP221 0
4
CMP220 0 R/W
3
CMP219 0
2
CMP218 0
1
CMP217 0
0
CMP216 0
Compare register 2 data
7
CMP231 0
6
CMP230 0
5
CMP229 0
4
CMP228 0 R/W
3
CMP227 0
2
CMP226 0
1
CMP225 0
0
CMP224 0
Compare register 2 data
TMRC Compare Register 3 (TCCMP3) 7
TCCMP3LL (FFFF_F44C)
bit Symbol Read/Write After reset Function 0 0 0 0 Compare register 3 data CMP307
6
CMP306
5
CMP305
4
CMP304 R/W
3
CMP303 0
2
CMP302 0
1
CMP301 0
0
CMP300 0
7
TCCMP3LH (0xFFFF_F44D)
bit Symbol Read/Write After reset Function 0 CMP315
6
CMP314 0
5
CMP313 0
4
CMP312 0 R/W
3
CMP311 0
2
CMP310 0
1
CMP309 0
0
CMP308 0
Compare register 3 data
7
TCCMP3HL (0xFFFF_F44E)
bit Symbol Read/Write After reset Function 0 CMP323
6
CMP322 0
5
CMP321 0
4
CMP320 0 R/W
3
CMP319 0
2
CMP318 0
1
CMP317 0
0
CMP316 0
Compare register 3 data
7
TCCMP3HH (0xFFFF_F44F) bit Symbol Read/Write After reset Function 0 CMP331
6
CMP330 0
5
CMP329 0
4
CMP328 0 R/W
3
CMP327 0
2
CMP326 0
1
CMP325 0
0
CMP324 0
Compare register 3 data
Fig. 12-14 TMRC-related Registers
TMP19A43 (rev2.0) 12-18
32-bit Input Capture (TMRC)
TMP19A43
TMRC Compare Register 4 (TCCMP4) 7
TCCMP4LL (0xFFFF_F450) bit Symbol Read/Write After reset Function TCCMP4LH (0xFFFF_F451) bit Symbol Read/Write After reset Function TCCMP4HL (0xFFFF_F452) bit Symbol Read/Write After reset Function TCCMP4HH (0xFFFF_F453) bit Symbol Read/Write After reset Function 0 0 0 0 Compare register 4 data 0 0 0 0 Compare register 4 data 0 0 0 0 Compare register 4 data 0 0 0 0 Compare register 4 data CMP407
6
CMP406
5
CMP405
4
CMP404 R/W
3
CMP403 0
2
CMP402 0
1
CMP401 0
0
CMP400 0
7
CMP415
6
CMP414
5
CMP413
4
CMP412 R/W
3
CMP411 0
2
CMP410 0
1
CMP409 0
0
CMP408 0
7
CMP423
6
CMP422
5
CMP421
4
CMP420 R/W
3
CMP419 0
2
CMP418 0
1
CMP417 0
0
CMP416 0
7
CMP431
6
CMP430
5
CMP429
4
CMP428 R/W
3
CMP427 0
2
CMP426 0
1
CMP425 0
0
CMP424 0
TMRC Compare Register 5 (TCCMP5) 7
TCCMP5LL (0xFFFF_F454) bit Symbol Read/Write After reset Function TCCMP5LH (0xFFFF_F455) bit Symbol Read/Write After reset Function TCCMP5HL (0xFFFF_F456) bit Symbol Read/Write After reset Function TCCMP5HH (0xFFFF_F457) bit Symbol Read/Write After reset Function 0 0 0 0 Compare register 5 data 0 0 0 0 Compare register 5 data 0 0 0 0 Compare register 5 data 0 0 0 0 Compare register 5 data CMP507
6
CMP506
5
CMP505
4
CMP504 R/W
3
CMP503 0
2
CMP502 0
1
CMP501 0
0
CMP500 0
7
CMP515
6
CMP514
5
CMP513
4
CMP512 R/W
3
CMP511 0
2
CMP510 0
1
CMP509 0
0
CMP508 0
7
CMP523
6
CMP522
5
CMP521
4
CMP520 R/W
3
CMP519 0
2
CMP518 0
1
CMP517 0
0
CMP516 0
7
CMP531
6
CMP530
5
CMP529
4
CMP528 R/W
3
CMP527 0
2
CMP526 0
1
CMP525 0
0
CMP524 0
Fig. 12-15 TMRC-related Registers
TMP19A43 (rev2.0) 12-19
32-bit Input Capture (TMRC)
TMP19A43
TMRC Compare Register 6 (TCCMP6) 7
TCCMP6LL (0xFFFF_F458) bit Symbol Read/Write After reset Function TCCMP6LH (0xFFFF_F459) bit Symbol Read/Write After reset Function TCCMP6HL bit Symbol (0xFFFF_F45A) Read/Write After reset Function TCCMP6HH bit Symbol (0xFFFF_F45B) Read/Write After reset Function 0 0 0 0 Compare register 6 data 0 0 0 0 Compare register 6 data CMP607
6
CMP606
5
CMP605
4
CMP604 R/W
3
CMP603 0
2
CMP602 0
1
CMP601 0
0
CMP600 0
7
CMP615
6
CMP614
5
CMP613
4
CMP612 R/W
3
CMP611 0
2
CMP610 0
1
CMP609 0
0
CMP608 0
7
CMP623 0
6
CMP622 0
5
CMP621 0
4
CMP620 0 R/W
3
CMP619 0
2
CMP618 0
1
CMP617 0
0
CMP616 0
Compare register 6 data
7
CMP631 0
6
CMP630 0
5
CMP629 0
4
CMP628 0 R/W
3
CMP627 0
2
CMP626 0
1
CMP625 0
0
CMP624 0
Compare register 6 data
TMRC Compare Register 7 (TCCMP7) 7
TCCMP7LL bit Symbol (0xFFFF_F45C) Read/Write After reset Function TCCMP7LH bit Symbol (0xFFFF_F45D) Read/Write After reset Function TCCMP7HL bit Symbol (0xFFFF_F45E) Read/Write After reset Function TCCMP7HH bit Symbol (0xFFFF_F45F) Read/Write After reset Function CMP707 0
6
CMP706 0
5
CMP705 0
4
CMP704 0 R/W
3
CMP703 0
2
CMP702 0
1
CMP701 0
0
CMP700 0
Compare register 7 data
7
CMP715 0
6
CMP714 0
5
CMP713 0
4
CMP712 0 R/W
3
CMP711 0
2
CMP710 0
1
CMP709 0
0
CMP708 0
Compare register 7 data
7
CMP723 0
6
CMP722 0
5
CMP721 0
4
CMP720 0 R/W
3
CMP719 0
2
CMP718 0
1
CMP717 0
0
CMP716 0
Compare register 7 data
7
CMP731 0
6
CMP730 0
5
CMP729 0
4
CMP728 0 R/W
3
CMP727 0
2
CMP726 0
1
CMP725 0
0
CMP724 0
Compare register 7 data
Fig. 12-16 TMRC-related Registers
TMP19A43 (rev2.0) 12-20
32-bit Input Capture (TMRC)
TMP19A43
13. Serial Channel (SIO)
13.1 Features
This device has three serial I/O channels: SIO0 to SIO2. Each channel operates in either the UART mode (asynchronous communication) or the I/O interface mode (synchronous communication) which is selected by the user. I/O interface mode Mode 0: This is the mode to send and receive I/O data and associated synchronization signals (SCLK) to extend I/O. Mode 1: TX/RX Data Length: 7 bits Mode 2: TX/RX Data Length: 8 bits Mode 3: TX/RX Data Length: 9 bits In the above modes 1 and 2, parity bits can be added. The mode 3 has a wakeup function in which the master controller can start up slave controllers via the serial link (multi-controller system). Fig. 13-2 shows the block diagram of SIO0. Each channel consists of a prescaler, a serial clock generation circuit, a receive buffer and its control circuit, and a send buffer and its control circuit. Each channel functions independently. As the SIOs 0 to 2 operate in the same way, Only SIO0 is described here.
Asynchronous (UART) mode:
Mode 0 (I/O interface mode)/LSB first bit 0 1 2 3 4 5 6 7
Transmission direction Mode 0 (I/O interface mode)/MSB first bit 7
6
5
4
3
2
1
0
Transmission direction Mode 1 (7-bit UART mode) Without parity start bit 0 1 2 3 4 5 6 stop
With parity
start
bit 0
1
2
3
4
5
6
parity stop
Mode 2 (8-bit UART mode) Without parity start bit 0 1 2 3 4 5 6 7 stop
With parity
start
bit 0
1
2
3
4
5
6
7
parity stop
Mode 3 (9-bit UART mode) start bit 0 1 2 3 4 5 6 7 8 stop
start
bit 0
1
2
3
4
5
6
7
bit 8
Stop (wake-up)
If bit 8 =1, represents address (select code). If bit 8 =0, represents data.
Fig. 13-1 Data Format TMP19A43(rev2.0) 13-1 Serial Channel (SIO)
TMP19A43
13.2
Block Diagram (Channel 0)
T0
2 T1
4
Prescaler 8 16 32 64 128 T4 T16 T64 TB0OUT (from TMRB0) BR0ADD UART Mode
Serial clock generation circuit BR0CR BR0CR T1 T4 T16 T64
Selector
Selector
Selector
Divider
SIOCLK
fSYS/2
BR0CR Baud rate generator /2
SC0MOD0 Selector
SC0MOD0
SCLK0 input (shares P62)
I/O interface mode
SCLK0 output (shares P62)
I/O interface mode
SC0CR Interrupt request (INTRX0) Interrupt request (INTTX0)
Receive counter (16 only with UART) RXDCLK SC0MOD0 Receive control
SC0MOD0
Serial channel interrupt control
Transmit counter (16 only with UART) TXDCLK Transmit control
SC0CR Parity control RXD0 (shares P61)
Receive buffer 1 (shift register)
CTS0 (shares P62)
SC0MOD0
Send buffer 1 (shift register)
TXD0 (shares P60)
RB8 Receive buffer 2 (SC0BUF) FIFO control Internal data bus
Error flag
TB8
Send buffer 2 (SC0BUF)
SC0CR Internal data bus
FIFO control
Internal data bus
Fig. 13-2 SIO0 Block Diagram
TMP19A43(rev2.0) 13-2
Serial Channel (SIO)
TMP19A43
13.3
13.3.1
Operation of Each Circuit (Channel 0)
Prescaler
The device includes a 7-bit prescaler to generate necessary clocks to drive SIO0. The input clock T0 to the prescaler is selected by SYSCR of CG to provide the frequency of either fperiph/2, fperiph/4, fperiph/8, or fperiph/16. The clock frequency fperiph is either the clock "fgear," to be selected by SYSCR1 of CG, or the clock "fc" before it is divided by the clock gear. The prescaler becomes active only when the baud rate generator is selected for generating the serial transfer clock. Table 13-1 lists the prescaler output clock resolution.
TMP19A43(rev2.0) 13-3
Serial Channel (SIO)
TMP19A43
Table 13-1 Clock Resolution to the Baud Rate Generator
Clear peripheral clock Clock gear value Prescaler clock selection
@ = 40MHz
Prescaler output clock resolution T1 fc/25(0.8 s) fc/24(0.4 us) fc/2 (0.2us) fc/2 (0.1us) fc/26(1.6 s) fc/25(0.8us) fc/2 (0.4us) fc/2 (0.2 us) fc/27(3.2 us)
3 4 2 3 6
T4 fc/27(3.2 s) fc/2 (1.6 s) fc/25(0.8us) fc/2 (0.4us) fc/28(6.4 s)
4 8
T16 fc/29(12.8 s) fc/2 (6.4 s) fc/27(3.2us) fc/2 (1.6 s)
6
T64 fc/211(51.2s) fc/210(25.6 s) fc/29(12.8s) fc/28(6.4 s) fc/212 (102 s) fc/211(51.2s) fc/210(25.6 s) fc/29(12.8s) fc/213(204s) fc/212 (102s) fc/211(51.2s) fc/210(25.6 s) fc/214(410us) fc/213(204s) fc/212 (102s) fc/211(51.2s) fc/211(51.2s) fc/210(25.6 s) fc/29(12.8s) fc/28(6.4 s) fc/211(51.2s) fc/210(25.6 s) fc/29(12.8s) fc/28(6.4 s) fc/211(51.2s) fc/210(25.6 s) fc/29(12.8s) fc/28(6.4 s) fc/211(51.2s) fc/210(25.6 s) fc/29(12.8s) fc/28(6.4 s)
00(fperiph/16) 000 (fc) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 100(fc/2) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 0 (fgear) 110(fc/4) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 111(fc/8) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 000 (fc) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 100(fc/2) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 1 (fc) 110(fc/4) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2) 00(fperiph/16) 111(fc/8) 01(fperiph/8) 10(fperiph/4) 11(fperiph/2)
fc/210(25.6 s) fc/2 (12.8s)
9
fc/2 (3.2us) fc/26(1.6 ms) fc/25(0.8 us)
fc/29(12.8s) fc/2 (6.4 s) fc/27(3.2 us)
8
7
fc/28(6.4 s)
fc/2 (3.2 us) fc/211(51.2s) fc/2 (25.6 s)
10 7
fc/2 (1.6 s)
6
fc/2 (0.8 us) fc/2 (0.4 us) fc/28(6.4 s) fc/2 (3.2 us)
7 4
5
fc/29(12.8s)
fc/2 (1.6 s)
6
fc/2 (6.4 s)
8
fc/210(25.6 s) fc/2 (12.8s) fc/28(6.4 s) fc/27(3.2 us) fc/27(3.2 us) fc/2 (1.6 s) fc/25(0.8 us)
6 9
fc/212 (102 s) fc/2 (51.2s) fc/210(25.6 s) fc/2 (12.8s) fc/29(12.8s) fc/2 (6.4 s) fc/27(3.2 us)
8 9 11
fc/26(1.6 s)
fc/2 (0.8 us) fc/2 (0.8 us) fc/2 (0.4 us) fc/2 (0.2 us) fc/22(0.1 us) fc/2 (0.8 us) fc/2 (0.4 us) fc/2 (0.2 us)
3 4 5 3 4 5 5
fc/2 (0.4 us)
fc/27(3.2 us) fc/2 (1.6 s) fc/25(0.8 us)
6
4
fc/2 (1.6 us) fc/29(12.8s) fc/2 (6.4 s) fc/27(3.2 us)
8
6
fc/2 (0.8 us)
5
fc/2 (0.4 us) fc/2 (3.2 us) fc/2 (1.6 s) fc/25(0.8 us)
6 7
4
fc/2 (1.6 us) fc/29(12.8s) fc/2 (6.4 s) fc/27(3.2 us)
8
6

fc/2 (0.8 us) fc/2 (0.4 us)
4 5
fc/2 (3.2 us) fc/2 (1.6 s) fc/25(0.8 us)
6 7
fc/2 (1.6 us) fc/29(12.8s) fc/2 (6.4 s) fc/27(3.2 us)
8
6
fc/2 (1.6 us)
6
(Note 1) The prescaler output clock Tn must be selected so that the relationship "Tn < fsys/2" is satisfied (so that Tn is slower than fsys/2). (Note 2) Do not change the clock gear while SIO is operating. (Note 3) The horizontal lines in the above table indicate that the setting is prohibited. The serial interface baud rate generator uses four different clocks, i.e., T1, T4, T16 and T64, supplied from the prescaler output clock.
13.3.2
Baud Rate Generator
The baud rate generator generates transmit and receive clocks to determine the serial channel transfer rate. The baud rate generator uses either the T1, T4, T16 or T64 clock supplied from the 7-bit prescaler. This input clock selection is made by setting the baud rate setting register, BR0CR . The baud rate generator contains built-in dividers for divide by 1, (N + m/16), and 16 where N is a TMP19A43(rev2.0) 13-4 Serial Channel (SIO)
TMP19A43
number from 2 to 15 and m is a number from 0 to 15. The division is performed according to the settings of the baud rate control registers BR0CR and BR0ADD to determine the resulting transfer rate. * UART Mode: 1) If BR0CR = 0, The setting of BR0ADD is ignored and the counter is divided by N where N is the value set to BR0CR . (N = 1 to 16). 2) If BR0CR = 1, The N + (16 - K)/16 division function is enabled and the division is made by using the values N (set in BR0CR ) and K (set in BR0ADD). (N = 2 to 15, K = 1 to 15) Note For the N values of 1 and 16, the above N+(16-K)/16 division function is inhibited. So, be sure to set BR0CR to "0."
*
I/O interface mode: The N + (16 - K)/16 division function cannot be used in the I/O interface mode. Be sure to divide by N, by setting BR0CR to "0."
*
Baud rate calculation to use the baud rate generator: 1) UART mode Baud rate =
Baud rated generator input clock Frequency divided by the divide ratio The highest baud rate out of the baud rate generator is 625 kbps when T1 is 10 MHz. The fsys/2 frequency, which is independent of the baud rate generator, can be used as the serial clock. In this case, the highest baud rate will be 1.25 Mbps when fsys is 40 MHz. /16
TMP19A43(rev2.0) 13-5
Serial Channel (SIO)
TMP19A43
2)
I/O interface mode Baud rate = Baud rated generator input clock Frequency divided by the divide ratio The highest baud rate will be generated when T1 is 10 MHz. If double buffering is used, the divide ratio can be set to "1" and the resulting output baud rate will be 5 Mbps. (If double buffering is not used, the highest baud rate will be 2.5 Mbps applying the divide ratio of "2.") /2
*
Example baud rate setting: 1) Division by an integer (divide by N): Selecting fc = 39.321 MHz for fperiph, setting T0 to fperiph/16, using the baud rate generator input clock T1, setting the divide ratio N (BR0CR) = 4, and setting BR0CR = "0," the resulting baud rate in the UART mode is calculated as follows: * Clocking conditions System clock : High-speed (fc) x 1 (fc) fperiph/16 (fperiph = fsys)
High speed clock gear : Prescaler clock : Baud rate =
fc/32 4
/16
= 39.321 (bps) x 106 / 32 / 4 / 16 19200 (bps)
(Note)
The divide by (N + (16-K)/16) function is inhibited and thus BR0ADD is ignored.
2)
For divide by N + (16-K)/16 (only for UART mode): Selecting fc = 19.2 MHz for fperiph, setting T0 to fperiph/16, using the baud rate generator input clock T2, setting the divide ratio N (BR0CR) = 7, setting K (BR0ADD) = 3, and selecting BR0CR = 1, the resulting baud rate is calculated as follows: * Clocking conditions System clock : High-speed (fc) x 1 (fc) fperiph/4 (fperiph = fsys)
High-speed clock gear : Prescaler clock : Baud rate =
7+ fc/32 /16 (16 - 3) 16
= 19.2 x 106 / 64 / (7 +
13 16
) / 16 = 4800 (bps)
TMP19A43(rev2.0) 13-6
Serial Channel (SIO)
TMP19A43
Also, an external clock input may be used as the serial clock. The resulting baud rate calculation is shown below:
*
Baud rate calculation for an external clock input: 1) UART mode Baud Rate = external clock input / 16 In this, the period of the external clock input must be equal to or greater than 4/fsys. If fsys = 40 MHz, the highest baud rate will be 40 / 4 / 16 = 625 (kbps). 2) I/O interface mode Baud Rate = external clock input When double buffering is used, it is necessary to satisfy the following relationship: External clock input period > 12/fsys Therefore, when fsys = 40 MHz, the baud rate must be set to a rate lower than 40 / 12 = 3.3 (Mbps). When double buffering is not used, it is necessary to satisfy the following relationship: External clock input period > 16/fsys Therefore, when fsys = 40 MHz, the baud rate must be set to a rate lower than 40 / 16 = 2.5 (Mbps).
Example baud rates for the UART mode are shown in Table 13-2 and Table 13-3.
TMP19A43(rev2.0) 13-7
Serial Channel (SIO)
TMP19A43
Table 13-2 Selection of UART Baud Rate
(Use the baud rate generator with BR0CR = 0)
Input clock fc [MHz] Divide ratio N (Set to BR0CR ) 19.6608 24.576 29.4912 1 2 4 8 0 5 A 1 2 3 4 6 C T1 (fc/4) 307.200 153.600 76.800 38.400 19.200 76.800 38.400 460.800 230.400 153.600 115.200 76.800 38.400 T4 (fc/16) 76.800 38.400 19.200 9.600 4.800 19.200 9.600 115.200 57.600 38.400 28.800 19.200 9.600 T16 (fc/64) 19.200 9.600 4.800 2.400 1.200 4.800 2.400 28.800 14.400 9.600 7.200 4.800 2.400
Unit (kbps)
T64 (fc/256) 4.800 2.400 1.200 0.600 0.300 1.200 0.600 7.200 3.600 2.400 1.800 1.200 0.600
(Note)
This table shows the case where the system clock is set to fc, the clock gear is set to fc/1, and the prescaler clock is set to fperiph/2.
Table 13-3 Selection of UART Baud Rate
(The TMRB0 timer output (internal TB0OUT) is used with the timer input clock set to T0.)
Unit (kbps)
fc TB0REG 1H 2H 3H 4H 5H 6H 8H AH 10H 14H
29.4912 MHz 230.4 115.2 76.8 57.6 46.08 38.4 28.8 23.04 14.4 11.52
24.576 MHz 192 96 64 48 38.4 32 24 19.2 12 9.6
24 MHz 187.5 93.75 62.5 46.88 37.5 31.25 23.44 18.75 11.72 9.38
19.6608 MHz 153.6 76.8 51.2 38.4 30.72 25.6 19.2 15.36 9.6 7.68
16 MHz 125 62.5 41.67 31.25 25 20.83 15.63 12.5 7.81 6.25
12.288 MHz 96 48 32 24 19.2 16 12 9.6 6 4.8
Baud rate calculation to use the TMRB0 timer: Transfer rate =
Clock frequency selected by SYSCR0 < PRCK1 : 0 > TB0REG x 2 x 16
(When input clock to the timer TMRB0 is T0)
(Note 1) In the I/O interface mode, the TMRB0 timer output signal cannot be used internally as the transfer clock. (Note 2) This table shows the case where the system clock is set to fc, the clock gear is set to fc/1, and the prescaler clock is set to fperiph/4.
TMP19A43(rev2.0) 13-8
Serial Channel (SIO)
TMP19A43
13.3.3
Serial Clock Generation Circuit
This circuit generates basic transmit and receive clocks.
*
I/O interface mode: In the SCLK output mode with the SC0CR serial control register set to "0," the output of the previously mentioned baud rate generator is divided by 2 to generate the basic clock. In the SCLK input mode with SC0CR set to "1," rising and falling edges are detected according to the SC0CR setting to generate the basic clock.
*
Asynchronous (UART) mode: According to the settings of the serial control mode register SC0MOD0 , either the clock from the baud rate register, the system clock (fSYS/2), the internal output signal of the TMRB0 timer, or the external clock (SCLKO pin) is selected to generate the basic clock, SIOCLK.
13.3.4
Receive Counter
The receive counter is a 4-bit binary counter used in the asynchronous (UART) mode and is up-counted by SIOCLK. Sixteen SIOCLK clock pulses are used in receiving a single data bit while the data symbol is sampled at the seventh, eighth, and ninth pulses. From these three samples, majority logic is applied to decide the received data.
13.3.5
Receive Control Unit
*
I/O interface mode: In the SCLK output mode with SC0CR set to "0," the RXD0 pin is sampled on the rising edge of the shift clock output to the SCLK0 pin. In the SCLK input mode with SC0CR set to "1," the serial receive data RXD0 pin is sampled on the rising or falling edge of SCLK input depending on the SC0CR setting.
*
Asynchronous (UART) mode: The receive control unit has a start bit detection circuit, which is used to initiate receive operation when a normal start bit is detected.
13.3.6
Receive Buffer
The receive buffer is of a dual structure to prevent overrun errors. The first receive buffer (a shift register) stores the received data bit-by-bit. When a complete set of bits have been stored, they are moved to the second receive buffer (SC0BUF). At the same time, the receive buffer full flag (SC0MOD2 "RBFLL") is set to "1" to indicate that valid data is stored in the second receive buffer. However, if the receive FIFO is set enabled, the receive data is moved to the receive FIFO and this flag is immediately cleared. If the receive FIFO has been disabled (SCOFCNF = 0 and =01), the INTRX0 interrupt is generated at the same time. If the receive FIFO has been enabled (SCNFCNF = 1 and = 01), an interrupt will be generated according to the SC0RFC setting.
TMP19A43(rev2.0) 13-9
Serial Channel (SIO)
TMP19A43
The CPU will read the data from either the second receive buffer (SC0BUF) or from the receive FIFO (the address is the same as that of the receive buffer). If the receive FIFO has not been enabled, the receive buffer full flag is cleared to "0" by the read operation. The next data received can be stored in the first receive buffer even if the CPU has not read the previous data from the second receive buffer (SC0BUF) or the receive FIFO.
If SCLK is set to generate clock output in the I/O interface mode, the double buffer control bit SC0MOD2 can be programmed to enable or disable the operation of the second receive buffer (SCOBUF). By disabling the second receive buffer (i.e., the double buffer function) and also disabling the receive FIFO (SCOFCNF = 0 and = 01), handshaking with the other side of communication can be enabled and the SCLK output stops each time one frame of data is transferred. In this setting, the CPU reads data from the first receive buffer. By the read operation of CPU, the SCLK output resumes. If the second receive buffer (i.e., double buffering) is enabled but the receive FIFO is not enabled, the SCLK output is stopped when the first receive data is moved from the first receive buffer to the second receive buffer and the next data is stored in the first buffer filling both buffers with valid data. When the second receive buffer is read, the data of the first receive buffer is moved to the second receive buffer and the SCLK output is resumed upon generation of the receive interrupt INTRX. Therefore, no buffer overrun error will be caused in the I/O interface SCLK output mode regardless of the setting of the double buffer control bit SC0MOD2 . If the second receive buffer (double buffering) is enabled and the receive FIFO is also enabled (SCNFCNF = 1 and = 01/11), the SCLK output will be stopped when the receive FIFO is full (according to the setting of SCOFNCF ) and both the first and second receive buffers contain valid data. Also in this case, if SCOFCNF has been set to "1," the receive control bit RXE will be automatically cleared upon suspension of the SCLK output. If it is set to "0," automatic clearing will not be performed.
(Note)
In this mode, the SC0CR flag is insignificant and the operation is undefined. Therefore, before switching from the SCLK output mode to another mode, the SC0CR register must be read to initialize this flag.
In other operating modes, the operation of the second receive buffer is always valid, thus improving the performance of continuous data transfer. If the receive FIFO is not enabled, an overrun error occurs when the data in the second receive buffer (SC0BUF) has not been read before the first receive buffer is full with the next receive data. If an overrun error occurs, data in the first receive buffer will be lost while data in the second receive buffer and the contents of SC0CR remain intact. If the receive FIFO is enabled, the FIFO must be read before the FIFO is full and the second receive buffer is written by the next data through the first buffer. Otherwise, an overrun error will be generated and the receive FIFO overrun error flag will be set. Even in this case, the data already in the receive FIFO remains intact.
The parity bit to be added in the 8-bit UART mode as well as the most significant bit in the 9-bit UART mode will be stored in SC0CR .
TMP19A43(rev2.0) 13-10
Serial Channel (SIO)
TMP19A43
In the 9-bit UART mode, the slave controller can be operated in the wake-up mode by setting the wakeup function SC0MOD0 to "1." In this case, the interrupt INTRX0 will be generated only when SC0CR is set to "1."
13.3.7
Receive FIFO Buffer
In addition to the double buffer function already described, data may be stored using the receive FIFO buffer. By setting of the SC0FCNF register and of the SC0MOD1 register, the 4byte receive buffer can be enabled. Also, in the UART mode or I/O interface mode, data may be stored up to a predefined fill level. When the receive FIFO buffer is to be used, be sure to enable the double buffer function. If data with parity bit is to be received in the UART mode, parity check must be performed each time a data frame is received.
13.3.8
Receive FIFO Operation
I/O interface mode with SCLK output: The following example describes the case a 4-byte data stream is received in the half duplex mode: SC0RFC<7:6>=01: Clears receive FIFO and sets the condition of interrupt generation. SC0RFC<1:0>=00: Sets the interrupt to be generated at fill level 4. SC0FCNF <1:0>=10111: Automatically inhibits continued reception after reaching the fill level. The number of bytes to be used in the receive FIFO is the same as the interrupt generation fill level. In this condition, 4-byte data reception may be initiated by setting the half duplex transmission mode and writing "1" to the RXE bit. After receiving 4 bytes, the RXE bit is automatically cleared and the receive operation is stopped (SCLK is stopped). Receive buffer 1 1 byte Receive buffer 2 1 byte RX FIFO 1 byte 2 byte 2 byte 1 byte 3 byte 3 byte 2 byte 1 byte 4 byte 4 byte 3 byte 2 byte 1 byte RBFLL Receive interrupt RXE 2 byte 3 byte 4 byte
Fig. 13-3 Receive FIFO Operation
TMP19A43(rev2.0) 13-11
Serial Channel (SIO)
TMP19A43
I/O interface mode with SCLK input: The following example describes the case a 4-byte data stream is received: SC0RFC <7:6> = 10: Clears receive FIFO and sets the condition of interrupt generation SC0RFC <1:0> = 00: Sets the interrupt to be generated at fill level 4. SC0FCNF <1:0> = 10101: Automatically allows continued reception after reaching the fill level. The number of bytes to be used in the receive FIFO is the maximum allowable number. In this condition, 4-byte data reception can be initiated along with the input clock by setting the half duplex transmission mode and writing "1" to the RXE bit. When the 4-byte data reception is completed, the receive FIFO interrupt will be generated. Note that preparation for the next data reception can be managed in this setting, i.e., the next 4-byte data can be received before data is fully read from the FIFO. Receive buffer 1 1 byte Receive buffer 2 1 byte RX FIFO 1 byte 2 byte 2 byte 1 byte 3 byte 3 byte 2 byte 1 byte 4 byte 4 byte 3 byte 2 byte 1 byte 2 byte 3 byte 4 byte
RBFLL Receive interrupt RXE
Fig. 13-4 Receive FIFO Operation
TMP19A43(rev2.0) 13-12
Serial Channel (SIO)
TMP19A43
13.3.9
Transmit Counter
The transmit counter is a 4-bit binary counter used in the asynchronous communication (UART) mode. It is counted by SIOCLK as in the case of the receive counter and generates a transmit clock (TXDCLK) on every 16th clock pulse.
SIOCLK 15 TXDCLK 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2
Fig. 13-5 Transmit Clock Generation
13.3.10 Transmit Control Unit
*
I/O interface mode: In the SCLK output mode with SC0CR set to "0," each bit of data in the send buffer is output to the TXD0 pin on the rising edge of the shift clock output from the SCLK0 pin. In the SCLK input mode with SC0CR set to "1," each bit of data in the send buffer is output to the TXD0 pin on the rising or falling edge of the input SCLK signal according to the SC0CR setting.
*
Asynchronous (UART) mode: When the CPU writes data to the send buffer, data transmission is initiated on the rising edge of the next TXDCLK and the transmit shift clock (TXDSFT) is also generated.
TMP19A43(rev2.0) 13-13
Serial Channel (SIO)
TMP19A43
*
Handshake function The CTS pin enables frame by frame data transmission so that overrun errors can be prevented. This function can be enabled or disabled by SC0MOD0 . When the CTS0 pin is set to the "H" level, the current data transmission can be completed but the next data transmission is suspended until the CTS0 pin returns to the "L" level. However in this case, the INTTX0 interrupt is generated, the next transmit data is requested to the CPU, data is written to the send buffer, and it waits until it is ready to transmit data. Although no RTS pin is provided, a handshake control function can be easily implemented by assigning a port for the RTS function. By setting the port to "H" level upon completion of data reception (in the receive interrupt routine), the transmit side can be requested to suspend data transmission.
TXD
RXD
CTS
Transmit side
RTS (Any port)
Receive side
Fig. 13-6 Handshake Function
Data write timing to send buffer or shift register
Transmission is suspended during this period
CTS
13 SIOCLK
14
15
16
1
2
3
14
15
16
1
2
3
TXDCLK
TXD
start bit
bit 0
(Note)
If the CTS signal is set to "H" during transmission, the next data transmission is suspended after the current transmission is completed. Data transmission starts on the first falling edge of the TXDCLK clock after CTS is set to "L." Fig. 13-7 CTS (Clear to Send) Signal Timing
TMP19A43(rev2.0) 13-14
Serial Channel (SIO)
TMP19A43
13.3.11 Transmit Buffer
The send buffer (SC0BUF) is in a dual structure. The double buffering function may be enabled or disabled by setting the double buffer control bit in serial mode control register 2 (SC0MOD2). If double buffering is enabled, data written to send buffer 2 (SCOBUF) is moved to send buffer 1 (shift register). If the transmit FIFO has been disabled (SCOFCNF = 0 or 1 and = 01), the INTTX interrupt is generated at the same time and the send buffer empty flag of SC0MOD2 is set to "1." This flag indicates that send buffer 2 is now empty and that the next transmit data can be written. When the next data is written to send buffer 2, the flag is cleared to "0." If the transmit FIFO has been enabled (SCNFCNF = 1 and = 10/11), any data in the transmit FIFO is moved to the send buffer 2 and flag is immediately cleared to "0." The CPU writes data to send buffer 2 or to the transmit FIFO. If the transmit FIFO is disabled in the I/O interface SCLK input mode and if no data is set in send buffer 2 before the next frame clock input, which occurs upon completion of data transmission from send buffer 1, an under-run error occurs and a serial control register (SC0CR) parity/under-run flag is set. If the transmit FIFO is enabled in the I/O interface SCLK input mode, when data transmission from send buffer 1 is completed, the send buffer 2 data is moved to send buffer 1 and any data in transmit FIFO is moved to send buffer 2 at the same time. If the transmit FIFO is disabled in the I/O interface SCLK output mode, when data in send buffer 2 is moved to send buffer 1 and the data transmission is completed, the SCLK output stops. So, no underrun errors can be generated. If the transmit FIFO is enabled in the I/O interface SCLK output mode, the SCLK output stops upon completion of data transmission from send buffer 1 if there is no valid data in the transmit FIFO.
Note)
In the I/O interface SCLK output mode, the SC0CR flag is insignificant. In this case, the operation is undefined. Therefore, to switch from the SCLK output mode to another mode, SC0CR must be read in advance to initialize the flag.
If double buffering is disabled, the CPU writes data only to send buffer 1 and the transmit interrupt INTTX is generated upon completion of data transmission. If handshaking with the other side is necessary, set the double buffer control bit to "0" (disable) to disable send buffer 2; any setting for the transmit FIFO should not be performed.
TMP19A43(rev2.0) 13-15
Serial Channel (SIO)
TMP19A43
13.3.12 Transmit FIFO Buffer
In addition to the double buffer function already described, data may be stored using the transmit FIFO buffer. By setting of the SC0FCNF register and of the SC0MOD1 register, the 4byte send buffer can be enabled. In the UART mode or I/O interface mode, up to 4 bytes of data may be stored. If data is to be transmitted with a parity bit in the UART mode, parity check must be performed on the receive side each time a data frame is received.
13.3.13 Transmit FIFO Operation
I/O interface mode with SCLK output (normal mode): The following example describes the case a 4-byte data stream is transmitted: SC0TFC <7:6> = 01: Clears transmit FIFO and sets the condition of interrupt generation SC0TFC <1:0> = 00: Sets the interrupt to be generated at fill level 0. SC0FCNF <1:0> = 01011: Inhibits continued transmission after reaching the fill level. In this condition, data transmission can be initiated by setting the transfer mode to half duplex, writing 4 bytes of data to the transmit FIFO, and setting the bit to "1." When the last transmit data is moved to the send buffer, the transmit FIFO interrupt is generated. When transmission of the last data is completed, the clock is stopped and the transmission sequence is terminated.
Data 6 Data 5 Data 4 Data 3
TX FIFO
Data 6 Data 5 Data 4 Data 6 Data 5 Data 6 Data 6
Send buffer 2 Send buffer 1
Data 2
Data 3
Data 4
Data 5
Data 5
Data 1
Data 2
Data 3
Data 4
TBEMP INTTX0 TXE
Fig. 13-8 Transmit FIFO Operation
TMP19A43(rev2.0) 13-16
Serial Channel (SIO)
TMP19A43
I/O interface mode with SCLK input (normal mode): The following example describes the case a 4-byte data stream is transmitted: SC0TFC <1:0> = 01: Clears the transmit FIFO and sets the condition of interrupt generation. SC0TFC <7:2> = 000000: Sets the interrupt to be generated at fill level 0. SC0FCNF <4:0> = 01001: Allows continued transmission after reaching the fill level. In this condition, data transmission can be initiated along with the input clock by setting the transfer mode to half duplex, writing 4 bytes of data to the transmit FIFO, and setting the bit to "1." When the last transmit data is moved to the send buffer, the transmit FIFO interrupt is generated.
TX FIFO
Data 6 Data 5 Data 4 Data 3
Data 6 Data 5 Data 4 Data 6 Data 5 Data 6 Data 6
Send buffer 2 Send buffer 1
Data 2
Data 3
Data 4
Data 5
Data 5
Data 1
Data 2
Data 3
Data 4
TBEMP INTTX0 TXE
Fig. 13-9 Transmit FIFO Operation
TMP19A43(rev2.0) 13-17
Serial Channel (SIO)
TMP19A43
13.3.14 Parity Control Circuit
If the parity addition bit of the serial control register SC0CR is set to "1," data is sent with the parity bit. Note that the parity bit may be used only in the 7- or 8-bit UART mode. The bit of SC0CR selects either even or odd parity. Upon data transmission, the parity control circuit automatically generates the parity with the data written to the send buffer (SC0BUF). After data transmission is complete, the parity bit will be stored in SC0BUF bit 7 in the 7-bit UART mode and in bit 7 in the serial mode control register SC0MOD in the 8-bit UART mode. The and settings must be completed before data is written to the send buffer. Upon data reception, the parity bit for the received data is automatically generated while the data is shifted to receive buffer 1 and moved to receive buffer 2 (SC0BUF). In the 7-bit UART mode, the parity generated is compared with the parity stored in SC0BUF , while in the 8-bit UART mode, it is compared with the bit 7 of the SC0CR register. If there is any difference, a parity error occurs and the flag of the SC0CR register is set. In the I/O interface mode, the SC0CR flag functions as an under-run error flag, not as a parity flag.
13.3.15 Error Flag
Three error flags are provided to increase the reliability of received data. 1. Overrun error : Bit 4 of the serial control register SC0CR In both UART and I/O interface modes, this bit is set to "1" when an error is generated by completing the reception of the next frame receive data before the receive buffer has been read. If the receive FIFO is enabled, the received data is automatically moved to the receive FIFO and no overrun error will be generated until the receive FIFO is full (or until the usable bytes are fully occupied). This flag is set to "0" when it is read. In the I/O interface SCLK output mode, no overrun error is generated and therefore, this flag is inoperative and the operation is undefined. 2. Parity error/under-run error : Bit 3 of the SC0CR register In the UART mode, this bit is set to "1" when a parity error is generated. A parity error is generated when the parity generated from the received data is different from the parity received. This flag is set to "0" when it is read. In the I/O interface mode, this bit indicates an under-run error. When the double buffer control bit of the serial mode control register SC0MOD2 is set to "1" in the SCLK input mode, if no data is set to the transmit double buffer before the next data transfer clock after completing the transmission from the transmit shift register, this error flag is set to "1" indicating an under-run error. If the transmit FIFO is enabled, any data content in the transmit FIFO will be moved to the buffer. When the transmit FIFO and the double buffer are both empty, an under-run error will be generated. Because no under-run errors can be generated in the SCLK output mode, this flag is inoperative and the operation is undefined. If send buffer 2 is disabled, the under-run flag will not be set. This flag is set to "0" when it is read.
TMP19A43(rev2.0) 13-18
Serial Channel (SIO)
TMP19A43
3.
Framing error : Bit 2 of the SC0CR register In the UART mode, this bit is set to "1" when a framing error is generated. This flag is set to "0" when it is read. A framing error is generated if the corresponding stop bit is determined to be "0" by sampling the bit at around the center. Regardless of the (stop bit length) setting of the serial mode control register 2, SC0MOD2, the stop bit status is determined by only 1 bit on the receive side.
Operation mode UART Error flag OERR PERR FERR OERR PERR FERR OERR PERR FERR Function Overrun error flag Parity error flag Framing error flag Overrun error flag Underrun error flag (WBUF = 1) Fixed to 0 (WBUF = 0) Fixed to 0 Operation undefined Operation undefined Fixed to 0
I/O interface (SCLK input)
I/O interface (SCLK output)
TMP19A43(rev2.0) 13-19
Serial Channel (SIO)
TMP19A43
13.3.16 Direction of Data Transfer
In the I/O interface mode, the direction of data transfer can be switched between "MSB first" and "LSB first" by the data transfer direction setting bit of the SC0MOD2 serial mode control register 2. Don't switch the direction when data is being transferred.
13.3.17 Stop Bit Length
In the UART mode transmission, the stop bit length can be set to either 1 or 2 bits by bit 4 of the SC0MOD2 register.
13.3.18 Status Flag
If the double buffer function is enabled (SC0MOD2 = "1"), the bit 6 flag of the SC0MOD2 register indicates the condition of receive buffer full. When one frame of data has been received and transferred from buffer 1 to buffer 2, this bit is set to "1" to show that buffer 2 is full (data is stored in buffer 2). When the receive buffer is read by CPU/DMAC, it is cleared to "0." If is set to "0," this bit is insignificant and must not be used as a status flag. When double buffering is enabled (SC0MOD2 = "1"), the bit 7 flag of the SC0MOD2 register indicates that send buffer 2 is empty. When data is moved from send buffer 2 to send buffer 1 (shift register), this bit is set to "1" indicating that send buffer 2 is now empty. When data is set to the send buffer by CPU/DMAC, the bit is cleared to "0." If is set to "0," this bit is insignificant and must not be used as a status flag.
13.3.19 Configurations of Send/Receive Buffers
= 0 UART I/O interface (SCLK input) I/O interface (SCLK output) Transmit buffer Receive buffer Transmit buffer Receive buffer Transmit buffer Receive buffer Single Double Single Double Single Single = 1 Double Double Double Double Double Double
13.3.20 software reset
Software reset is HSC0MOD2 "10" "01" SC0MOD0RXESC0MOD1SC0MOD2TBEMP,RBFLL,TXRUN SC0CROERRPERRFERRand internal circuit is initialized. Other states are maintained.
TMP19A43(rev2.0) 13-20
Serial Channel (SIO)
TMP19A43
13.3.21 Signal Generation Timing
UART Mode: Receive Side
Mode Interrupt generation timing Framing error timing 9-bit Around the center of the 1st stop bit Around the center of the stop bit 8-bit with parity Around the center of the 1st stop bit Around the center of the stop bit Around the center of the last (parity) bit Around the center of the stop bit 8-bit, 7-bit, and 7-bit with parity Around the center of the 1st stop bit Around the center of the stop bit Around the center of the last (parity) bit Around the center of the stop bit
Parity error generation timing Overrun error generation Around the center timing of the stop bit
Transmit Side
Mode Interrupt generation timing ( = 0) Interrupt generation timing ( = 1) 9-bit 8-bit with parity 8-bit, 7-bit, and 7-bit with parity Just before the stop Just before the stop bit is Just before the stop bit is sent bit is sent sent Immediately after data is moved to send buffer 1 (just before start bit transmission) Immediately after data is Immediately after data is moved to moved to send buffer 1 send buffer 1 (just before start bit (just before start bit transmission) transmission)
I/O interface mode: Receive Side
Immediately after the rising edge of the last SCLK Interrupt generation SCLK output timing mode (WBUF = 0) SCLK input mode Immediately after the rising or falling edge of the last SCLK (for rising or falling edge mode, respectively) Interrupt generation SCLK output Immediately after the rising edge of the last SCLK (just after data timing mode transfer to receive buffer 2) or just after receive buffer 2 is read (WBUF = 1) SCLK input mode Immediately after the rising edge or falling edge of the last SCLK depending on the rising or falling edge triggering mode, respectively (right after data is moved to receive buffer 2) SCLK input mode Immediately after the rising or falling edge of the last SCLK (for Overrun error generation timing rising or falling edge mode, respectively)
Transmit Side
Immediately after the rising edge of the last SCLK Interrupt generation SCLK output timing mode (WBUF = 0) SCLK input mode Immediately after the rising or falling edge of the last SCLK (for rising or falling edge mode, respectively) Interrupt generation SCLK output Immediately after the rising edge of the last SCLK or just after timing mode data is moved to send buffer 1 (WBUF = 1) SCLK input mode Immediately after the rising or falling edge of the last SCLK (for the rising or falling edge mode, respectively) or just after data is moved to send buffer 1 SCLK input mode Immediately after the falling or rising edge of the next SCLK (for Under-run error generation timing the rising or falling edge triggering mode, respectively)
Note 1) Do not modify any control register when data is being sent or received (in a state ready to send or receive). Note 2) Do not stop the receive operation (by setting SC0MOD0 = "0") when data is being received. Note 3) Do not stop the transmit operation (by setting SC0MOD1 = "0") when data is being transmitted. TMP19A43(rev2.0) 13-21 Serial Channel (SIO)
TMP19A43
13.4
Register Description (Only for Channel 0)
7 bit Symbol TB8 0 Send data Bit 8 6 CTSE 0
Handshake function control 0: Disables CTS 1: Enables CTS
5 RXE 0 Receive control
4 WU R/W 0
3 SM1 0
2 SM0 0
1 SC1 0
0 SC0 0
SC0MOD0 Read/Write (0xFFFF_F262) After reset Function
Wake-up function 0: Disables 0: Disable reception 1: Enable
1: Enables reception
Serial transfer mode 00: I/O interface mode 01: 7-bit length UART mode 10: 8-bit length UART mode 11: 9-bit length UART mode
Serial transfer clock (for UART) 00: Timer TB0OUT 01: Baud rate generator 10: Internal fSYS/2 clock 11: External clock (SCLK0 input)
Note) In the I/O interface mode, the serial control register (SC0CR) is used for clock li Wakeup function 9-bit UART 0 1 Interrupt when received Interrupt at RB8=1 Other mode don't care
Handshake function ( CTS pin) enable 0 1 Disable (transmission is always allowed) Enable
Note)
With set to "0," set each mode register (SC0MOD0, SC0MOD1 and SC0MOD2). Then set to "1."
Fig. 13-10 Serial Mode Control Register 0 (for SIO0, SC0MOD0)
TMP19A43(rev2.0) 13-22
Serial Channel (SIO)
TMP19A43
7 SC0MOD1 (0xFFFF_F265) bit Symbol Read/Write After reset Function I2S0 R/W 0 IDLE 0: Stop 1: Start
6 FDPX1 R/W 0
5 FDPX0 R/W 0
4 TXE R/W 0 Transmit control 0: Disable 1: Enable
3 SINT2 R/W 0
2 SINT1 R/W 0
1 SINT0 R/W 0
0
Transfer mode setting 00: Transfer prohibited 01: Half duplex (RX) 10: Half duplex (TX) 11: Full duplex
Interval time of continuous transmission 000: None 100: 8SCLK 001: 1SCLK 101:16SCLK 010: 2SCLK 110: 32SCLK 011: 4SCLK 111: 64SCLK
- R/W 0 Write "0."
Fig. 13-11 Serial Mode Control Register 1 (for SIO0, SC0MOD1)
:
Specifies the interval time of continuous transmission when double buffering or FIFO is enabled in the I/O interface mode. This parameter is invalid for the UART mode or when an external clock is used. This bit enables transmission and is valid for all the transfer modes. If disabled while transmission is in progress, transmission is inhibited only after the current frame of data is completed for transmission.
:
: Configures the transfer mode in the I/O interface mode. Also configures the FIFO if it is enabled. In the UART mode, it is used only to specify the FIFO configuration. : Specifies the Idle mode operation.
TMP19A43(rev2.0) 13-23
Serial Channel (SIO)
TMP19A43
7 SC0MOD2 (0xFFFF_F266) bit Symbol Read/Write After reset 1 Send buffer empty flag 0: full 1: Empty TBEMP
6 RBFLL R 0 Receive buffer full flag 0: Empty 1: full
5 TXRUN 0 In transmissi on flag 0: Stop 1: Start
4 SBLEN 0 Stop bit 0: 1-bit 1: 2-bit
3 DRCHG 0 Setting transfer direction 0: LSB first 1: MSB first
2 WBUF R/W 0 W-buffer 0: Disable 1: Enable
1 SWRST1 0
0 SWRST0 0
Soft reset Overwrite "01" on "10" to reset
Function
: Overwriting "01" in place of "10" generates a software reset. When this software reset is executed, the mode register parameters SC0MOD0 , SC0MOD1, SC0MOD2 , , and , control register parameters SC0CR , , and , and their internal circuits are initialized. : This parameter enables or disables the send/receive buffers to send (in both SCLK output/input modes) and receive (in SCLK output mode) data in the I/O interface mode and to transmit data in the UART. In all other modes, double buffering is enabled regardless of the setting. Specifies the direction of data transfer in the I/O interface mode. In the UART mode, it is fixed to LSB first. This is a status flag to show that data transmission is in progress. When this bit is set to "1," it indicates that data transmission operation is in progress. If it is "0," the bit 7 is set to "1" to indicate that the transmission has been fully completed and the same is set to "0" to indicate that the send buffer contains some data waiting for the next transmission. This is a flag to show that the receive double buffers are full. When a receive operation is completed and received data is moved from the receive shift register to the receive double buffers, this bit changes to "1" while reading this bit changes it to "0." If double buffering is disabled, this flag is insignificant. This flag shows that the send double buffers are empty. When data in the send double buffers is moved to the send shift register and the double buffers are empty, this bit is set to "1." Writing data again to the double buffers sets this bit to "0." If double buffering is disabled, this flag is insignificant. This specifies the length of stop bit transmission in the UART mode. On the receive side, the decision is made using only a single bit regardless of the setting.
: :
:
:
:
(Note)
While data transmission is in progress, any software reset operation must be executed twice in succession.
Fig. 13-12 Serial Mode Control Register
TMP19A43(rev2.0) 13-24
Serial Channel (SIO)
TMP19A43
7 SC0CR (0xFFFF_F261) Read/Write After reset bit Symbol RB8 R 0 Receive data Bit 8 Function
6 EVEN R/W 0 Parity 0: Odd 1: Even
5 PE 0 Add parity 0: Disable 1: Enable
4 OERR 0
3 PERR 0
2 FERR 0
1 SCLKS R/W 0 0: SCLK0
0 IOC 0
0: Baud rate generator 1: SCLK0 pin input
R (cleared to "0" when read) 0: Normal operation 1: Error Overrun Parity/ under-run Framing
1: SCLK0
I/O interface input clock selection 0 Baud rate generator 1 SCLK0 pin input
Edge selection for SCLK0 input operation 0 Data send/receive at rising edges of SCLK0 1 Data send/receive at falling edges of SCLK0 Cleared to "0" when read
Framing error flag Parity error/under-run error flag Overrun error flag
Add/check even parity 0 1 Odd parity Even parity
(Note)
Any error flag is cleared when read.
Fig. 13-13 Serial Control Register (for SIO0, SC0CR)
TMP19A43(rev2.0) 13-25
Serial Channel (SIO)
TMP19A43
7 bit Symbol BR0CR (0xFFFF_F263) Read/Write After reset 0 Write "0."
6 BR0ADDE 0
5 BR0CK1 0
4 BR0CK0 R/W 0
3 BR0S3 0
2 BR0S2 0
1 BR0S1 0
0 BR0S0 0
-
N+(16-K)/16 00: T1 divider 01: T4 function
Function
0: Disable 1: Enable
10: T16 11: T64
Divide ratio "N"
Select input clock to the baud rate generator 00 Internal clock T1 01 10 11
7 bit Symbol BR0ADD (0xFFFF_F264) Read/Write After reset Always reads "0." Specify K for the "N + (16 - K)/16" division Function R 0 0 0 6 5
Internal clock T4 Internal clock T16 Internal clock T64
4 3 BR0K3 2 BR0K2 R/W 0 0 1 BR0K1 0 BR0K0
~
~
Setting divide ratio of the baud rate generator BR0CR = 1 BR0CR 0000 (N = 16) 0010 (N = 2) BR0ADD 0000 0001 (K = 1) 1111 (K = 15)
~
BR0CR = 0 0001 (N = 1) (ONLY UART) 1111 (N = 15) 0000 (N = 16)
~
0001 (N = 1)
1111 (N = 15)
Disable Disable
Disable N+ (16 - K) Division
16
Divide by N
(Note 1) In the UART mode, the division ratio "1" of the baud rate generator can be specified only when the "N + (16 - K)/16" division function is not used. In the I/O interface mode, the division ratio "1" of the baud rate generator can be specified only when double buffering is used. (Note 2) To use the "N + (16 - K)/16" division function, be sure to set BR0CR to "1" after setting the K value (K = 1 to 15) to BR0ADD . However, don't use the "N + (16 K)/16" division function when BR0CR is set to either "0000" or "0001" (N = 16 or 1). (Note 3) The "N + (16 - K)/16" division function can only be used in the UART mode. In the I/O interface mode, the "N + (16 - K)/16" division function must be disabled (prohibited) by setting BR0CR to "0." Fig. 13-14 Baud Rate Generator Control (for SIO0, BR0CR, BR0ADD) TMP19A43(rev2.0) 13-26 Serial Channel (SIO)
TMP19A43
7 bit Symbol Read/Write SC0BUF (0xFFFF_F260) After reset Function 0 TB7/RB7
6 TB6/RB6 0
5 TB5/RB5 0
4 TB4/RB4 0 R/W
3 TB3/RB3 0
2 TB2/RB2 0
1 TB1/RB1 0
0 TB0/RB0 0
TB7 to TB0: Send buffer + FIFO RB7 to RB0: Receive buffer + FIFO
Fig. 13-15 Note: HSC0BUF works as a send buffer for WR operation and as a receive buffer for RD operation.
Fig. 13-16 FIFO Configuration Register
7 bit Symbol Read/Write SC0FCNF (0xFFFF_F26C) After reset 0 0 0 0 Bytes used in RX FIFO Reserved 6 Reserved 5 Reserved 4 RFST R/W 0 0 RX interrupt for RX FIFO 0: Disable 1: Enable 0 Automatic disable of RXE/TXE 0: None 1: Auto Disable 0 FIFO Enable 0: Disable 1: Enable TX interrupt for TX 0: Maximum FIFO 1: Same as 0: Disable Fill level 1: Enable
of RX FIFO
3 TFIE
2 RFIE
1 RXTXCNT
0 CNFG
Be sure to write "000."
Function
: If enabled, the SCOMOD1 setting automatically configures FIFO as follows: = 01 (Half duplex RX) ---- 4-byte RX FIFO = 10 (Half duplex TX) ---- 4-byte TX FIFO = 11 (Full duplex) ---- 2-Byte RX FIFO + 2-Byte TX FIFO :0 The function to automatically disable RXE/TXE bits is disabled. 1: If enabled, the SCOMOD1 is used to set as follows: = 01 (Half duplex RX) ------ When the RX FIFO is filled up to the specified number of valid bytes, RXE is automatically set to "0" to inhibit further reception. = 10 (Half duplex TX) ------ When the TX FIFO is empty, TXE is automatically set to "0" to inhibit further transmission. = 11 (Full duplex) ----------- When either of the above two conditions is satisfied, TXE/RXE are automatically set to "0" to inhibit further transmission and reception. : When RX FIFO is enabled, receive interrupts are enabled or disabled by this parameter. : When TX FIFO is enabled, transmit interrupts are enabled or disabled by this parameter. : When RX FIFO is enabled, the number of RX FIFO bytes to be used is selected. 0: The maximum number of bytes of the FIFO configured 4 bytes when = 01 (Half duplex RX) and 2 bytes for = 11 (Full duplex) 1: Same as the fill level for receive interrupt generation specified by SC0RFC .
(Note 1) Regarding TX FIFO, the maximum number of bytes being configured is always available. The available number of bytes is the bytes already written to the TX FIFO.
TMP19A43(rev2.0) 13-27
Serial Channel (SIO)
TMP19A43
Fig. 13-17 Receive FIFO Control Register
7 bit Symbol Read/Write SC0RFC (0xFFFF_F268) After reset RFCS W 0 Clear RX FIFO 1: Clear Function Always reads "0." 6 RFIS R/W 0 Select interrupt generation condition Always reads "0." R 0 0 5 4 3 2 1 RIL1 R/W 0 FIFO fill level to generate RX interrupts 00: 4 bytes (2 bytes if full duplex) 01: 1byte 10: 2byte 11: 3byte Note: RIL1 is ignored when FDPX1:0 = 11 (full duplex) 0 RIL0
0: An interrupt is generated when the specified fill level is reached. 1: An interrupt is generated when the specified fill level is reached or if the specified fill level has been exceeded at the time data is read.
Transmit FIFO Configuration Register
7 bit Symbol Read/Write SC0TFC (0xFFFF_F269) After reset TFCS w 0 Clear TX FIFO 1: Clear Always reads "0." 6 TFIS R/W 0 Select interrupt generation condition Always reads "0." R 0 0 5 4 3 2 1 TIL1 R/W 0 FIFO fill level to generate TX interrupts 00: Empty 01: 1byte 10: 2byte 11: 3byte Note: TIL1 is ignored when FDPX1:0 = 11 (full duplex). 0 TIL0
Function
0: An interrupt is generated when the specified fill level is reached. 1: An interrupt is generated when the specified fill level is reached or if the level is lower than the specified fill level at the time new data is written.
Fig. 13-18 Receive FIFO Status Register
7 bit Symbol Read/Write SC0RST (0xFFFF_F26A) After reset ROR R 0 RX FIFO Overrun Function
1: Generated
6
5 R 0
4
3
2 RLVL2 0
1 RLVL1 R 0
0 RLVL0 0
Always reads "0."
Status of RX FIFO fill level 000: Empty 001: 1Byte 010: 2Byte 011: 3Byte 100: 4Byte
(Note)
The bit is cleared to "0" when receive data is read from the SC0BUF register.
TMP19A43(rev2.0) 13-28
Serial Channel (SIO)
TMP19A43
Fig. 13-19 Transmit FIFO Status Register
7 bit Symbol Read/Write SC0TST (0xFFFF_F26B) After reset TUR R 1 TX FIFO Under run Function
1: Generated
6
5 R 0
4
3
2 TLVL2 0
1 TLVL1 R 0
0 TLVL0 0
Always reads "0."
Cleared by writing to FIFO
Status of TX FIFO fill level 000: Empty 001: 1Byte 010: 2Byte 011: 3Byte 100: 4Byte
(Note)
The bit is cleared to "0" when transmit data is written to the SC0BUF register.
SIO Enable Register
7 bit Symbol Read/Write R 0 Always reads "0." Function 6 5 4 3 2 1 0 SIOE R/W 0 SIO operation 0: Disable 1: Enable
SC0EN (0xFFFF_F267)
After reset
: It specifies SIO operation. When SIO operation is disabled, the clock will not be supplied to the SIO module except for the register part and thus power dissipation can be reduced (other registers cannot be accessed for read/write operation). When SIO is to be used, be sure to enable SIO by setting "1" to this register before setting any other registers of the SIO module. If SIO is enabled once and then disabled, any register setting is maintained.
TMP19A43(rev2.0) 13-29
Serial Channel (SIO)
TMP19A43
13.5
13.5.1
Operation in Each Mode
Mode 0 (I/O interface mode)
Mode 0 consists of two modes, i.e., the "SCLK output" mode to output synchronous clock and the "SCLK input" mode to accept synchronous clock from an external source. The following operational descriptions are for the case use of FIFO is disabled. For details of FIFO operation, refer to the previous sections describing receive/transmit FIFO functions. Sending data SCLK output mode In the SCLK output mode, if SC0MOD2 is set to "0" and the send double buffers are disabled, 8 bits of data are output from the TXD0 pin and the synchronous clock is output from the SCLK0 pin each time the CPU writes data to the send buffer. When all data is output, the INTTX0 interrupt is generated. If SC0MOD2 is set to "1" and the send double buffers are enabled, data is moved from send buffer 2 to send buffer 1 when the CPU writes data to send buffer 2 while data transmission is halted or when data transmission from send buffer 1 (shift register) is completed. When data is moved from send buffer 2 to send buffer 1, the send buffer empty flag SC0MOD2 is set to "1," and the INTTX0 interrupt is generated. If send buffer 2 has no data to be moved to send buffer 1, the INTTX0 interrupt is not generated and the SCLK0 output stops.
Transmit data write timing SCLK0 output
TXD0 (INTTX0 interrupt request)
TXRUN
bit 0
bit 1
bit 6
bit 7
bit 0
= "0" (if double buffering is disabled)
Transmit data write timing SCLK0 output
TXD0
(INTTX0 interrupt request)
bit 0
bit 1
bit 6
bit 7
bit 0
TBRUN TBEMP
= "1" (if double buffering is enabled) (if there is data in buffer 2)
TMP19A43(rev2.0) 13-30
Serial Channel (SIO)
TMP19A43
Transmit data write timing SCLK0 output TXD0
(INTTX0 interrupt request)
bit 0
bit 1
bit 6
bit 7
TBRUN TBEMP
= "1" (if double buffering is enabled) (if there is no data in buffer 2)
Fig. 13-20 Send Operation in the I/O Interface Mode (SCLK0 Output Mode)
SCLK input mode In the SCLK input mode, if SC0MOD2 is set to "0" and the send double buffers are disabled, 8-bit data that has been written in the send buffer is output from the TXD0 pin when the SCLK0 input becomes active. When all 8 bits are sent, the INTTX0 interrupt is generated. The next send data must be written before the timing point "A" as shown in Fig. 13-21. If SC0MOD2 is set to "1" and the send double buffers are enabled, data is moved from send buffer 2 to send buffer 1 when the CPU writes data to send buffer 2 before the SCLK0 becomes active or when data transmission from send buffer 1 (shift register) is completed. As data is moved from send buffer 2 to send buffer 1, the send buffer empty flag SC0MOD2 is set to "1" and the INTTX0 interrupt is generated. If the SCLK0 input becomes active while no data is in send buffer 2, although the internal bit counter is started, an under-run error occurs and 8-bit dummy data (FFh) is sent.
A
Transmit data write timing SCLK0 input (=0 (=0, rising edge mode) SCLK0 input (=1, falling edge mode)
TXD0
(INTTX0 interrupt request)
bit 0
bit 1
bit 5
bit 6
bit 7
bit 0
bit 1
= "0" (if double buffering is disabled)
TMP19A43(rev2.0) 13-31
Serial Channel (SIO)
TMP19A43
A
Transmit data write timing SCLK0 input (=0, rising edge mode) SCLK0 input (=1 falling edge mode)
TXD0
(INTTX0 interrupt request)
bit 0
bit 1
bit 5
bit 6
bit 7
bit 0
bit 1
TBRUN TBEMP
= "1" (if double buffering is enabled) (if there is data in buffer 2)
A
Transmit data write timing SCLK0 input (=0 rising edge mode) SCLK0 input (=1 falling edge mode)
TXD0
(INTTX0 interrupt request)
bit 0
bit 1
bit 5
bit 6
bit 7
1
TBRUN TBEMP
PERR (functions to detect under-run errors)
= "1" (if double buffering is enabled) (if there is no data in buffer 2)
Fig. 13-21 Send Operation in the I/O Interface Mode (SCLK0 Input Mode)
TMP19A43(rev2.0) 13-32
Serial Channel (SIO)
TMP19A43
Receiving data SCLK output mode In the SCLK output mode, if SC0MOD2 = "0" and receive double buffering is disabled, a synchronous clock pulse is output from the SCLK0 pin and the next data is shifted into receive buffer 1 each time the CPU reads received data. When all the 8 bits are received, the INTRX0 interrupt is generated. The first SCLK output can be started by setting the receive enable bit SC0MOD0 to "1." If the receive double buffering is enabled with SC0MOD2 set to "1," the first frame received is moved to receive buffer 2 and receive buffer 1 can receive the next frame successively. As data is moved from receive buffer 1 to receive buffer 2, the receive buffer full flag SC0MOD2 is set to "1" and the INTRX0 interrupt is generated. While data is in receive buffer 2, if CPU/DMAC cannot read data from receive buffer 2 in time before completing reception of the next 8 bits, the INTRX0 interrupt is not generated and the SCLK0 clock stops. In this state, reading data from receive buffer 2 allows data in receive buffer 1 to move to receive buffer 2 and thus the INTRX0 interrupt is generated and data reception resumes.
Receive data write timing
SCLK0 output RXD0 (INTRX0 interrupt request) bit 0 bit 1 bit 6 bit 7 bit 0
= "0" (if double buffering is disabled)
Receive data read timing
SCLK0 output RXD0
(INTRX0 interrupt request)
bit 7
bit 0
bit 1
bit 6
bit 7
bit 0
RBFULL
= "1" (if double buffering is enabled) (if data is read from buffer 2)
TMP19A43(rev2.0) 13-33
Serial Channel (SIO)
TMP19A43
Receive data read timing
SCLK0 output RXD0
(INTRX0 interrupt request)
bit 7
bit 0
bit 1
bit 6
bit 7
RBFULL
= "1" (if double buffering is enabled) (if data cannot be read from buffer 2)
Fig. 13-22 Receive Operation in the I/O Interface Mode (SCLK0 Output Mode)
SCLK input mode In the SCLK input mode, since receive double buffering is always enabled, the received frame can be moved to receive buffer 2 and receive buffer 1 can receive the next frame successively. The INTRX receive interrupt is generated each time received data is moved to received buffer 2.
Receive data read timing SCLK0 input (=0 rising edge mode) SCLK0 input (=1 falling edge mode) RXD0
(INTRX0 interrupt request)
bit 0
bit 1
bit 5
bit 6
bit 7
bit 0
RBFULL
If data is read from buffer 2
Receive data read timing SCLK0 input (=0 rising edge mode) SCLK0 input (=1 falling edge mode) RXD0
(INTRX0 interrupt request)
bit 0
bit 1
bit 5
bit 6
bit 7
bit 0
RBFULL OERR
If data cannot be read from buffer 2
Fig. 13-23 Receive Operation in the I/O Interface Mode (SCLK0 Input Mode) (Note) To receive data, SC0MOD must always be set to "1" (receive enable) regardless of the SCLK input or output mode.
TMP19A43(rev2.0) 13-34
Serial Channel (SIO)
TMP19A43
Send and receive (full-duplex) The full-duplex mode is enabled by setting bit 6 of the serial mode control register 1 (SC0MOD1) to "1."
SCLK output mode In the SCLK output mode, if SC0MOD2 is set to "0" and both the send and receive double buffers are disabled, SCLK is output when the CPU writes data to the send buffer. Subsequently, 8 bits of data are shifted into receive buffer 1 and the INTRX0 receive interrupt is generated. Concurrently, 8 bits of data written to the send buffer are output from the TXD0 pin, the INTTX0 send interrupt is generated when transmission of all data bits has been completed. Then, the SCLK output stops. In this, the next round of data transmission and reception starts when the data is read from the receive buffer and the next send data is written to the send buffer by the CPU. The order of reading the receive buffer and writing to the send buffer can be freely determined. Data transmission is resumed only when both conditions are satisfied. If SC0MOD2 = "1" and double buffering is enabled for both transmission and reception, SCLK is output when the CPU writes data to the send buffer. Subsequently, 8 bits of data are shifted into receive buffer 1, moved to receive buffer 2, and the INTRX0 interrupt is generated. While 8 bits of data is received, 8 bits of transmit data is output from the TXD0 pin. When all data bits are sent out, the INTTX0 interrupt is generated and the next data is moved from the send buffer 2 to send buffer 1. If send buffer 2 has no data to be moved to send buffer 1 (SC0MOD2 = 1) or when receive buffer 2 is full (SC0MOD2 = 1), the SCLK clock is stopped. When both conditions are satisfied, i.e., receive data is read and send data is written, the SCLK output is resumed and the next round of data transmission is started.
Receive data read timing Transmit data write timing SCLK0 output TXD0 RXD0 (INTTX0 interrupt request) (INTRX0 interrupt request) bit 0 bit 0 bit 1 bit 1 bit 5 bit 5 bit 6 bit 6 bit 7 bit 7 bit 0 bit 0 bit 1 bit 1
= "0" (if double buffering is disabled)
TMP19A43(rev2.0) 13-35
Serial Channel (SIO)
TMP19A43
Receive data read timing Transmit data write timing SCLK0 output TXD0 RXD0
(INTTX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
(INTRX0 interrupt request)
= "1" (if double buffering is enabled)
Receive data read timing Transmit data write timing SCLK0 output TXD0 RXD0
(INTTX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
(INTRX0 interrupt request)
= "1" (if double buffering is enabled)
Fig. 13-24 Send/Receive Operation in the I/O Interface Mode (SCLK0 Output Mode)
SCLK input mode In the SCLK input mode with SC0MOD2 set to "0" and the send double buffers are disabled (double buffering is always enabled for the receive side), 8-bit data written in the send buffer is output from the TXD0 pin and 8 bits of data is shifted into the receive buffer when the SCLK input becomes active. The INTTX0 interrupt is generated upon completion of data transmission and the INTRX0 interrupt is generated at the instant the received data is moved from receive buffer 1 to receive buffer 2. Note that transmit data must be written into the send buffer before the SCLK input for the next frame (data must be written before the point A in Fig. 13-25). As double buffering is enabled for data reception, data must be read before completing reception of the next frame data. If SC0MOD2 = "1" and double buffering is enabled for both transmission and reception, the interrupt INTRX0 is generated at the timing send buffer 2 data is moved to send buffer 1 after completing data transmission from send buffer 1. At the same time, the 8 bits of data received is shifted to buffer 1, moved to receive buffer 2, and the INTRX0 interrupt is generated. Upon the SCLK input for the next frame, transmission from send buffer 1 (in which data has been moved from send buffer 2) is started while receive data is shifted into receive buffer 1 simultaneously. If data in receive buffer 2 has not been read when the last bit of the frame is received, an overrun
TMP19A43(rev2.0) 13-36
Serial Channel (SIO)
TMP19A43
error occurs. Similarly, if there is no data written to send buffer 2 when SCLK for the next frame is input, an under-run error occurs.
A
Receive data read timing Transmit data write timing SCLK0 input
TXD0 RXD0
(INTTX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
(INTRX0 interrupt request)
= "0" (if double buffering is disabled)
Receive data read timing Transmit data write timing SCLK0 input
TXD0 RXD0
(INTTX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
(INTRX0 interrupt request)
= "1" (if double buffering is enabled) (no errors)
TMP19A43(rev2.0) 13-37
Serial Channel (SIO)
TMP19A43
Receive data read timing Transmit data write timing SCLK0 input
TXD0 RXD0
(INTTX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
(INTRX0 interrupt request)
PERR (under-run error)
= "1" (if double buffering is enabled) (error generation)
Fig. 13-25 Send/Receive Operation in the I/O Interface Mode (SCLK0 Input Mode)
TMP19A43(rev2.0) 13-38
Serial Channel (SIO)
TMP19A43
13.5.2
Mode 1 (7-bit UART Mode)
The 7-bit UART mode can be selected by setting the serial mode control register (SC0MOD ) to "01." In this mode, parity bits can be added to the transmit data stream; the serial mode control register (SC0CR ) controls the parity enable/disable setting. When is set to "1" (enable), either even or odd parity may be selected using the SC0CR bit. The length of the stop bit can be specified using SC0MOD2.
Example: The control register settings for transmitting in the following data format are listed in the following table.
start bit 0 1 2 3 4 5 6 even parity stop
Transmission direction (Transmission rate of 2400bps, @fc =24.576MHz)
* Clocking conditions System clock High-speed clock gear Prescaler clock : High-speed (fc) : x 1 (fc) : fperiph/4 (fperiph = fsys)
P6CR P6FC P6FC2

SC0MOD 1 SC0CR X11XXX00 BR0CR 00101010 IMC4 -11X0100 SC0BUF * * * * * * * * Note: X: don't care - : no change
------- ------- ------- X0-X010
76543210 1 1 1
Designates P60 as the TXD0 pin. Sets the 7-bit UART mode. Adds even parity. Sets the data rate to 2400 bps. Enables the INTTX0 interrupt and sets to level 4 by the <31:24> bits of the 32 bit register. Sets the data to be sent.
TMP19A43(rev2.0) 13-39
Serial Channel (SIO)
TMP19A43
13.5.3
Mode 2 (8-bit UART Mode)
The 8-bit UART mode can be selected by setting SC0MOD0 to "10." In this mode, parity bits can be added and parity enable/disable is controlled using SC0CR . If = "1" (enabled), either even or odd parity can be selected using SC0CR . Example: The control register settings for receiving data in the following format are as follows:
start bit 0 1 2 3 4 5 6 7 odd parity stop
Transmission direction (Transmission rate of 9600bps, @fc =24.576MHz)
* Clocking conditions System clock High-speed clock gear Prescaler clock : High-speed (fc) : x 1 (fc) : fperiph/4 (fperiph = fsys)
Main routine settings

P6CR P6FC P6FC2
SC0MOD SC0CR X01XXX BR0CR 000101 IMC4 -11X01 SC0MOD
------ ------ ------ -00X10
76543210 0- 1 1
- -
Designates P62 as the RXD0 pin. Selects the 8-bit UART mode. Sets odd parity. Sets the data rate to 9600 bps. Enables the INTRX0 interrupt and sets to level 4 by the <23:16> bits of the 32 bit register. Enables reception of data.
01 00 01 00
--
1X
----
An example interrupt routine process
INTCLR X 1 0 0 1 0 0 0 Reg. SC0CR AND 0x1C if reg. is not "0" then error processing Set SC0BUF to Reg. Interrupt processing is completed Note: X: don't care - : no change Interrupt process start
Clears the interrupt request. 0x0000_0048 Performs error check Reads received data.
INTCLR=0x48
No SC0CR=0x1C ? Yes SC0BUF data read
Error processing
Interrupt process complete
TMP19A43(rev2.0) 13-40
Serial Channel (SIO)
TMP19A43
13.5.4
Mode 3 (9-bit UART)
The 9-bit UART mode can be selected by setting SC0MOD0 to "11." In this mode, parity bits must be disabled (SC0CR = "0"). The most significant bit (9th bit) is written to bit 7 of the serial mode control register 0 (SC0MOD0) for transmit data and it is stored in bit 7 of the serial control register SC0CR upon receiving data. When writing or reading data to/from the buffers, the most significant bit must be written or read first before writing or reading to/from SC0BUF. The stop bit length can be specified using SC0MOD2 . Wakeup function In the 9-bit UART mode, slave controllers can be operated in the wake-up mode by setting the wake-up function control bit SC0MOD0 to "1." In this case, the interrupt INTRX0 will be generated only when SC0CR is set to "1."
TXD
RXD
TXD
RXD
TXD
RXD
TXD
RXD
Master
Slave 1
Slave 2
Slave 3
(Note)
The TXD pin of the slave controller must be set to the open drain output mode using the ODE register. Fig. 13-26 Serial Links to Use Wake-up Function
TMP19A43(rev2.0) 13-41
Serial Channel (SIO)
TMP19A43
Protocol Select the 9-bit UART mode for the master and slave controllers. Set SC0MOD to "1" for the slave controllers to make them ready to receive data. The master controller is to send a single frame of data that includes the slave controller select code (8 bits). In this, the most significant bit (bit 8) must be set to "1."
start
bit 0
1
2
3
4
5
6
7
8 "1"
stop
Slave controller select code
Every slave controller receives the above data frame; if the code received matches with the controller's own select code, it clears the WU bit to "0." The master controller transmits data to the designated slave controller (the controller of which SC0MOD bit is cleared to "0"). In this, the most significant bit (bit 8) must be set to "0."
start
bit 0
1
2
3 data
4
5
6
7
bit 8 "0"
stop
The slave controllers with the bit set to "1" ignore the receive data because the most significant bit (bit 8) is set to "0" and thus no interrupt (INTRX0) is generated. Also, the slave controller with the bit set to "0" can transmit data to the master controller to inform that the data has been successfully received. Example setting: Using the internal clock fSYS/2 as the transfer clock, two slave controllers are serially linked as follows:
TXD
RXD
TXD
RXD
TXD
RXD
Master
Slave 1 Select code 00000001
Slave 2 Select code 00001010
TMP19A43(rev2.0) 13-42
Serial Channel (SIO)
TMP19A43
3) Master controller setting
Main routine P6CR P6FC P6FC2 IMCC4

------ ------ ------ -11-01 -
11
01 11 11 01
Designates P60/P61 as the TXD0/RXD0 pins, respectively.
Enables the INTRX0 interrupt and sets to level 5 by the <23:16> bits of the 32 bit register. Enables the INTTX0 interrupt and sets to level 4 by the <31:24> bits of the 32 bit register. Sets the 9-bit UART mode and fSYS/2 transfer clock. Sets the select code of Slave 1.
IMCC4
-
0100
SC0MOD0 1 0 1 0 1 1 1 0 SC0BUF 00000001 Interrupt routine (INTTX0) INTCLR X1001100 SC0MOD0 0 - - - - - - - SC0BUF ******** Interrupt processing is completed.
Clears the interrupt request. (INTTX0) Sets TB8 to "0." Sets the data to be sent.
4)
Slave controller setting
Main routine P6CR P6FC P6FC2 P6ODE IMC4 IMC4

110101 SC0MOD0 0 0 1 1 1 1 1 0 Interrupt routine (INTRX0) INTCLR 01001000 Reg. SC0BUF if Reg. = select code, Then SC0MOD0 - - - 0 - - - -
- - - - - -
- - - - - -
- - - -
- - - -
- - - -
- - - -
01 11 11 1
Designates P60 as TXD (open drain output) and P61 as RXD.
-
Enables INTTX0 and INTRX0. Sets the 9-bit UART mode and fSYS/2 transfer clock and sets to "1."
110110
Clears the interrupt request.
Clears to "0."
TMP19A43(rev2.0) 13-43
Serial Channel (SIO)
TMP19A43
14. Serial Channel (HSIO)
This device has three high-speed serial I/O channels: HSIO0 to HSIO2. Each channel operates in either the UART mode (asynchronous communication) or the I/O interface mode (synchronous communication) which is selected by the user. I/O interface mode Mode 0: This is the mode to send and receive I/O data and associated synchronization signals (HSCLK) to extend I/O. Mode 1: TX/RX Data Length: 7 bits Mode 2: TX/RX Data Length: 8 bits Mode 3: TX/RX Data Length: 9 bits In the above modes 1 and 2, parity bits can be added. The mode 3 has a wakeup function in which the master controller can start up slave controllers via the serial link (multi-controller system). Fig. 14-2 shows the block diagram of HSIO0. Each channel consists of a prescaler, a serial clock generation circuit, a receive buffer and its control circuit, and a send buffer and its control circuit. Each channel functions independently. As the HSIOs 0 to 2 operate in the same way, Only HSIO0 is described here.
Asynchronous (UART) mode:
Mode 0 (I/O interface mode)/LSB first bit 0 1 2 3 4 5 6 7
Transmission direction Mode 0 (I/O interface mode)/MSB first bit 7
6
5
4
3
2
1
0
Transmission direction Mode 1 (7-bit UART mode) Without parity start bit 0 1 2 3 4 5 6 stop
With parity
start
bit 0
1
2
3
4
5
6
parity stop
Mode 2 (8-bit UART mode) Without parity start bit 0 1 2 3 4 5 6 7 stop
With parity
start
bit 0
1
2
3
4
5
6
7
parity stop
Mode 3 (9-bit UART mode) start bit 0 1 2 3 4 5 6 7 8 stop
start
bit 0
1
2
3
4
5
6
7
bit 8
Stop (wake-up)
If bit 8 =1, represents address (select code). If bit 8 =0, represents data.
Fig. 14-1 Data Format
TMP19A43(rev2.0) 14-1
Serial Channel (HSIO)
TMP19A43
Serial clock generation circuit TB8OUT (from TMRB0) HBR0CR Divider HBR0ADD Selector Selector UART Mode
fSYS
HSIOCLK
HBR0CR Baud rate generator /2 HSCLK0 input (shares PB4)
HSC0MOD0 HSC0MOD0 Selector
I/O interface mode
I/O interface mode HSCLK0 output (shares PB4) Receive counter (16 only with UART) RXDCLK HSC0MOD0 Receive control
HSC0CR
Interrupt request HINTRX0 Transmit counter (16 only with UART) HTXDCLK Transmit control HCTS0 (shares PB4) HSC0MOD0 Send buffer 1 (shift register) HTXD0 (shares PB2) Interrupt request HINTTX0
HSC0MOD0 Serial channel interrupt control
HSC0CR Parity control HRXD0 (shares PB3)
Receive buffer 1 (shift register)
RB8
Receive buffer 2 (HSC0BUF)
Error flag
TB8
Send buffer 2 (HSC0BUF)
FIFO control
HSC0CR Internal data bus
FIFO control Internal data bus
Internal data bus
Fig. 14-2 HSIO0 Block Diagram Note: The baud rate generator cannot be set for "divide by 1."
TMP19A43(rev2.0) 14-2
Serial Channel (HSIO)
TMP19A43
14.1
14.1.1
Operation of Each Circuit (HSIO Channel 0)
Baud Rate Generator
The baud rate generator generates transmit and receive clocks to determine the serial channel transfer rate. The baud rate generator uses the sys/2 clock. The baud rate generator contains built-in dividers for divide by 1, (N + m/16), and 64 where N is a number from 2 to 63 and m is a number from 0 to 15. The division is performed according to the settings of the baud rate control registers HBR0CR and HBR0ADD to determine the resulting transfer rate. UART Mode: 1) If HBR0CR = 0, The setting of HBR0ADD is ignored and the counter is divided by N where N is the value set to HBR0CR . (N = 1 to 64). 2) If HBR0CR = 1, The N + (16 - K)/16 division function is enabled and the division is made by using the values N (set in HBR0CR ) and K (set in HBR0ADD). (N = 2 to 63, K = 1 to 15) Note For the N values of 1 and 16, the above N+(16-K)/16 division function is inhibited. So, be sure to set HBR0CR to "0."
I/O interface mode: The N + (16 - K)/16 division function cannot be used in the I/O interface mode. Be sure to divide by N, by setting HBR0CR to "0." Baud rate calculation to use the baud rate generator: 1) UART mode Baud rate =
fsys Frequency divided by the divide ratio
/16
The highest baud rate out of the baud rate generator is 2.5 Mbps when fsys is 40 MHz.
TMP19A43(rev2.0) 14-3
Serial Channel (HSIO)
TMP19A43
2)
I/O interface mode Baud rate =
fsys Frequency divided by the divide ratio
/2
The highest baud rate will be generated when fsys is 40 MHz. If double buffering is used, the divide ratio can be set to "2" and the resulting output baud rate will be 10 Mbps. (If double buffering is not used, the highest baud rate will be 5 Mbps applying the divide ratio of "2.") Example baud rate setting: 1) Division by an integer (divide by N): Using the baud rate generator input clock sys, setting the divide ratio N (HBR0CR) = 4, and setting HBR0CR = "0," the resulting baud rate in the UART mode is calculated as follows: * Clocking conditions System clock : High-speed (fc) x 1 (fc)
High speed clock gear : Baud rate =
fsys 4
/16
= 40 x 106 / 4 / 16 = 625 k (bps) (Note) The divide by (N + (16-K)/16) function is inhibited and thus HBR0ADD is ignored.
2)
For divide by N + (16-K)/16 (only for UART mode): Using the baud rate generator fsys, setting the divide ratio N (HBR0CR) = 4, setting K (HBR0ADD) = 14, and selecting HBR0CR = 1, the resulting baud rate is calculated as follows: * Clocking conditions System clock : High-speed (fc) x 1 (fc) High-speed clock gear : Baud rate =
4+ Fsys (16 - 14) 16
/16
= 40 x 106 / (4 +
2 16
) / 16 = 60.6 k (bps)
TMP19A43(rev2.0) 14-4
Serial Channel (HSIO)
TMP19A43
Also, an external clock input may be used as the serial clock. The resulting baud rate calculation is shown below: Baud rate calculation for an external clock input: 1) UART mode Baud Rate = external clock input / 16 In this, the period of the external clock input must be equal to or greater than 2/fsys. If fsys = 40 MHz, the highest baud rate will be 40 / 4 / 16 = 625 (kbps). 2) I/O interface mode Baud Rate = external clock input When double buffering is used, it is necessary to satisfy the following relationship: External clock input period > 6/fsys Therefore, when fsys = 40 MHz, the baud rate must be set to a rate lower than 40 / 12 = 3.3 (Mbps). When double buffering is not used, it is necessary to satisfy the following relationship: External clock input period > 8/fsys Therefore, when fsys = 40 MHz, the baud rate must be set to a rate lower than 40 / 16 = 2.5 (Mbps).
TMP19A43(rev2.0) 14-5
Serial Channel (HSIO)
TMP19A43
14.1.2
High-speed Serial Clock Generation Circuit
This circuit generates basic transmit and receive clocks. I/O interface mode: In the HSCLK output mode with the HSC0CR serial control register set to "0," the output of the previously mentioned baud rate generator is divided by 2 to generate the basic clock. In the HSCLK input mode with HSC0CR set to "1," rising and falling edges are detected according to the HSC0CR setting to generate the basic clock. Asynchronous (UART) mode: According to the settings of the serial control mode register HSC0MOD0 , either the clock from the baud rate register, the system clock (fSYS), the internal output signal of the TMRB8 timer, or the external clock (HSCLKO pin) is selected to generate the basic clock, HSIOCLK.
14.1.3
Receive Counter
The receive counter is a 4-bit binary counter used in the asynchronous (UART) mode and is up-counted by HSIOCLK. Sixteen HSIOCLK clock pulses are used in receiving a single data bit while the data symbol is sampled at the seventh, eighth, and ninth pulses. From these three samples, majority logic is applied to decide the received data.
14.1.4
Receive Control Unit
I/O interface mode: In the HSCLK output mode with HSC0CR set to "0," the HRXD0 pin is sampled on the rising edge of the shift clock output to the HSCLK0 pin. In the HSCLK input mode with HSC0CR set to "1," the serial receive data HRXD0 pin is sampled on the rising or falling edge of HSCLK input depending on the HSC0CR setting. Asynchronous (UART) mode: The receive control unit has a start bit detection circuit, which is used to initiate receive operation when a normal start bit is detected.
14.1.5
Receive Buffer
The receive buffer is of a dual structure to prevent overrun errors. The first receive buffer (a shift register) stores the received data bit-by-bit. When a complete set of bits have been stored, they are moved to the second receive buffer (HSC0BUF). At the same time, the receive buffer full flag (HSC0MOD2 "RBFLL") is set to "1" to indicate that valid data is stored in the second receive buffer. However, if the receive FIFO is set enabled, the receive data is moved to the receive FIFO and this flag is immediately cleared. If the receive FIFO has been disabled (HSCOFCNF = 0 and = 01), the HINTRX0 interrupt is generated at the same time. If the receive FIFO has been enabled (HSCNFCNF = 1 and SCOMOD1 = 01), an interrupt will be generated according to the HSC0RFC setting.
TMP19A43(rev2.0) 14-6
Serial Channel (HSIO)
TMP19A43
The CPU will read the data from either the second receive buffer (HSC0BUF) or from the receive FIFO (the address is the same as that of the receive buffer). If the receive FIFO has not been enabled, the receive buffer full flag is cleared to "0" by the read operation. The next data received can be stored in the first receive buffer even if the CPU has not read the previous data from the second receive buffer (HSC0BUF) or the receive FIFO. If HSCLK is set to generate clock output in the I/O interface mode, the double buffer control bit HSC0MOD2 can be programmed to enable or disable the operation of the second receive buffer (HSCOBUF). By disabling the second receive buffer (i.e., the double buffer function) and also disabling the receive FIFO (HSCOFCNF = 0 or 1 and = 10), handshaking with the other side of communication can be enabled and the HSCLK output stops each time one frame of data is transferred. In this setting, the CPU reads data from the first receive buffer. By the read operation of CPU, the HSCLK output resumes. If the second receive buffer (i.e., double buffering) is enabled but the receive FIFO is not enabled, the HSCLK output is stopped when the first receive data is moved from the first receive buffer to the second receive buffer and the next data is stored in the first buffer filling both buffers with valid data. When the second receive buffer is read, the data of the first receive buffer is moved to the second receive buffer and the HSCLK output is resumed upon generation of the receive interrupt HINTRX. Therefore, no buffer overrun error will be caused in the I/O interface HSCLK output mode regardless of the setting of the double buffer control bit HSC0MOD2 . If the second receive buffer (double buffering) is enabled and the receive FIFO is also enabled (HSCNFCNF = 1 and = 01/11), the HSCLK output will be stopped when the receive FIFO is full (according to the setting of HSCOFNCF ) and both the first and second receive buffers contain valid data. Also in this case, if HSCOFCNF has been set to "1," the receive control bit RXE will be automatically cleared upon suspension of the HSCLK output. If it is set to "0," automatic clearing will not be performed. (Note) In this mode, the HSC0CR flag is insignificant and the operation is undefined. Therefore, before switching from the HSCLK output mode to another mode, the HSC0CR register must be read to initialize this flag.
In other operating modes, the operation of the second receive buffer is always valid, thus improving the performance of continuous data transfer. If the receive FIFO is not enabled, an overrun error occurs when the data in the second receive buffer (HSC0BUF) has not been read before the first receive buffer is full with the next receive data. If an overrun error occurs, data in the first receive buffer will be lost while data in the second receive buffer and the contents of HSC0CR remain intact. If the receive FIFO is enabled, the FIFO must be read before the FIFO is full and the second receive buffer is written by the next data through the first buffer. Otherwise, an overrun error will be generated and the receive FIFO overrun error flag will be set. Even in this case, the data already in the receive FIFO remains intact. The parity bit to be added in the 8-bit UART mode as well as the most significant bit in the 9-bit UART mode will be stored in HSC0CR .
TMP19A43(rev2.0) 14-7
Serial Channel (HSIO)
TMP19A43
In the 9-bit UART mode, the slave controller can be operated in the wake-up mode by setting the wakeup function HSC0MOD0 to "1." In this case, the interrupt HINTRX0 will be generated only when HSC0CR is set to "1."
14.1.6
Receive FIFO Buffer
In addition to the double buffer function already described, data may be stored using the receive FIFO buffer. By setting of the HSC0FCNF register and of the HSC0MOD1 register, the 4-byte receive buffer can be enabled. Also, in the UART mode or I/O interface mode, data may be stored up to a predefined fill level. When the receive FIFO buffer is to be used, be sure to enable the double buffer function.
14.1.7
Receive FIFO Operation
I/O interface mode with HSCLK output: The following example describes the case a 4-byte data stream is received in the half duplex mode: HSC0RFC<7:6>=01: Clears receive FIFO and sets the condition of interrupt generation. HSC0RFC<1:0>=00: Sets the interrupt to be generated at fill level 4. HSC0FCNF <1:0>=10111: Automatically inhibits continued reception after reaching the fill level. The number of bytes to be used in the receive FIFO is the same as the interrupt generation fill level. In this condition, 4-byte data reception may be initiated by setting the half duplex transmission mode and writing "1" to the RXE bit. After receiving 4 bytes, the RXE bit is automatically cleared and the receive operation is stopped (HSCLK is stopped).
Receive buffer 1
1 byte
2 byte 1 byte
3 byte 2 byte 2 byte 1 byte
4 byte 3 byte 3 byte 2 byte 1 byte 4 byte 4 byte 3 byte 2 byte 1 byte
Receive buffer 2 RX FIFO
1 byte
RBFLL Receive interrupt RXE
Fig. 14-3 Receive FIFO Operation
TMP19A43(rev2.0) 14-8
Serial Channel (HSIO)
TMP19A43
I/O interface mode with HSCLK input: The following example describes the case a 4-byte data stream is received: HSC0RFC <7:6> = 10: Clears receive FIFO and sets the condition of interrupt generation HSC0RFC <1:0> = 00: Sets the interrupt to be generated at fill level 4. HSC0FCNF <1:0> = 10101: Automatically allows continued reception after reaching the fill level. The number of bytes to be used in the receive FIFO is the maximum allowable number. In this condition, 4-byte data reception can be initiated along with the input clock by setting the half duplex transmission mode and writing "1" to the RXE bit. When the 4-byte data reception is completed, the receive FIFO interrupt will be generated. Note that preparation for the next data reception can be managed in this setting, i.e., the next 4-byte data can be received before data is fully read from the FIFO.
Receive buffer 1 1 byte Receive buffer 2 1 byte RX FIFO 1 byte 2 byte 2 byte 1 byte 3 byte 3 byte 2 byte 1 byte 4 byte 4 byte 3 byte 2 byte 1 byte 2 byte 3 byte 4 byte
RBFLL Receive interrupt RXE
Fig. 14-4 Receive FIFO Operation
TMP19A43(rev2.0) 14-9
Serial Channel (HSIO)
TMP19A43
14.1.8
Transmit Counter
The transmit counter is a 4-bit binary counter used in the asynchronous communication (UART) mode. It is counted by HSIOCLK as in the case of the receive counter and generates a transmit clock (TXDCLK) on every 16th clock pulse.
SIOCLK 15 TXDCLK 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 2
Fig. 14-5 Transmit Clock Generation
14.1.9
Transmit Control Unit
I/O interface mode: In the HSCLK output mode with HSC0CR set to "0," each bit of data in the send buffer is output to the HTXD0 pin on the rising edge of the shift clock output from the HSCLK0 pin. In the HSCLK input mode with HSC0CR set to "1," each bit of data in the send buffer is output to the HTXD0 pin on the rising or falling edge of the input HSCLK signal according to the HSC0CR setting. Asynchronous (UART) mode: When the CPU writes data to the send buffer, the sending of data begins on the rising edge of the next HTXDCLK and a send shift clock (HTXDSFT) is generated.
TMP19A43(rev2.0) 14-10
Serial Channel (HSIO)
TMP19A43
Handshake function The H CTS pin enables frame by frame data transmission so that overrun errors can be prevented. This function can be enabled or disabled by HSC0MOD0 . When the H CTS0 pin is set to the "H" level, the current data transmission can be completed but the next data transmission is suspended until the H CTS0 pin returns to the "L" level. However in this case, the HINTTX0 interrupt is generated, the next transmit data is requested to the CPU, data is written to the send buffer, and it waits until it is ready to transmit data. Although no H RTS pin is provided, a handshake control function can be easily implemented by assigning a port for the H RTS function. By setting the port to "H" level upon completion of data reception (in the receive interrupt routine), the transmit side can be requested to suspend data transmission.
HTXD H CTS Transmit side
HRXD H RTS (Any port) Receive side
Fig. 14-6 Handshake Function
Data write timing to send buffer or shift register
Transmission is suspended during this period
H CTS
13 HSIOCLK
HTXD15
16
1
2
3
14
15
16
1
2
3
HTXDCLK
HTXD
start bit
bit 0
(Note)
If the H CTS signal is set to "H" during transmission, the next data transmission is suspended after the current transmission is completed. Data transmission starts on the first falling edge of the HTXDCLK clock after H CTS is set to "L." Fig. 14-7 H CTS (Clear to Send) Signal Timing
TMP19A43(rev2.0) 14-11
Serial Channel (HSIO)
TMP19A43
14.1.10 Transmit Buffer
The send buffer (HSC0BUF) is in a dual structure. The double buffering function may be enabled or disabled by setting the double buffer control bit in serial mode control register 2 (HSC0MOD2). If double buffering is enabled, data written to send buffer 2 (HSCOBUF) is moved to send buffer 1 (shift register). If the transmit FIFO has been disabled (HSCOFCNF = 0 or 1 and = 01), the HINTTX interrupt is generated at the same time and the send buffer empty flag of HSC0MOD2 is set to "1." This flag indicates that send buffer 2 is now empty and that the next transmit data can be written. When the next data is written to send buffer 2, the flag is cleared to "0." If the transmit FIFO has been enabled (HSCNFCNF = 1 and = 10/11), any data in the transmit FIFO is moved to the send buffer 2 and flag is immediately cleared to "0." The CPU writes data to send buffer 2 or to the transmit FIFO. If the transmit FIFO is disabled in the I/O interface HSCLK input mode and if no data is set in send buffer 2 before the next frame clock input, which occurs upon completion of data transmission from send buffer 1, an under-run error occurs and a serial control register (HSC0CR) parity/underrun flag is set. If the transmit FIFO is enabled in the I/O interface HSCLK input mode, when data transmission from send buffer 1 is completed, the send buffer 2 data is moved to send buffer 1 and any data in transmit FIFO is moved to send buffer 2 at the same time. If the transmit FIFO is disabled in the I/O interface HSCLK output mode, when data in send buffer 2 is moved to send buffer 1 and the data transmission is completed, the HSCLK output stops. So, no underrun errors can be generated. If the transmit FIFO is enabled in the I/O interface HSCLK output mode, the HSCLK output stops upon completion of data transmission from send buffer 1 if there is no valid data in the transmit FIFO.
Note)
In the I/O interface HSCLK output mode, the HSC0CR flag is insignificant. In this case, the operation is undefined. Therefore, to switch from the HSCLK output mode to another mode, HSC0CR must be read in advance to initialize the flag.
If double buffering is disabled, the CPU writes data only to send buffer 1 and the transmit interrupt HINTTX0 is generated upon completion of data transmission. If handshaking with the other side is necessary, set the double buffer control bit to "0" (disable) to disable send buffer 2 so the transmit FIFO is not configured.
TMP19A43(rev2.0) 14-12
Serial Channel (HSIO)
TMP19A43
14.1.11 Transmit FIFO Buffer
In addition to the double buffer function already described, data may be stored using the transmit FIFO buffer. By setting of the HSC0FCNF register and of the HSC0MOD1 register, the 4-byte send buffer can be enabled. In the UART mode or I/O interface mode, up to 4 bytes of data may be stored.
14.1.12 Transmit FIFO Operation
I/O interface mode with HSCLK output (normal mode): The following example describes the case a 4-byte data stream is transmitted: HSC0TFC <7:6> = 01: Clears transmit FIFO and sets the condition of interrupt generation HSC0TFC <1:0> = 00: Sets the interrupt to be generated at fill level 0. HSC0FCNF <1:0> = 01011: Inhibits continued transmission after reaching the fill level. In this condition, data transmission can be initiated by setting the transfer mode to half duplex, writing 4 bytes of data to the transmit FIFO, and setting the bit to "1." When the last transmit data is moved to the send buffer, the transmit FIFO interrupt is generated. When transmission of the last data is completed, the clock is stopped and the transmission sequence is terminated.
TX FIFO
data 6 data 5 data 4 data 3
data 6 data 5 data 4
data 6 data 5 data 6 data 6
Send buffer 2 Send buffer 1
data 2
data 3
data 4
data 5
data 5
data 1
data 2
data 3
data 4
TBEMP INTTX0 TXE
Fig. 14-8 Transmit FIFO Operation
TMP19A43(rev2.0) 14-13
Serial Channel (HSIO)
TMP19A43
I/O interface mode with HSCLK input (normal mode): The following example describes the case a 4-byte data stream is transmitted: HSC0TFC <1:0> = 01: Clears the transmit FIFO and sets the condition of interrupt generation. HSC0TFC <7:2> = 000000: Sets the interrupt to be generated at fill level 0. HSC0FCNF <4:0> = 01001: Allows continued transmission after reaching the fill level. In this condition, data transmission can be initiated along with the input clock by setting the transfer mode to half duplex, writing 4 bytes of data to the transmit FIFO, and setting the bit to "1." When the last transmit data is moved to the send buffer, the transmit FIFO interrupt is generated.
TX FIFO
data 6 data 5 data 4 data 3 data 6 data 5 data 4 data 6 data 5 data 6 data 6
Send buffer 2 Send buffer 1
data 2
data 3
data 4
data 5
data 5
data 1
data 2
data 3
data 4
TBEMP INTTX0 TXE
Fig. 14-9 Transmit FIFO Operation
TMP19A43(rev2.0) 14-14
Serial Channel (HSIO)
TMP19A43
14.1.13 Parity Control Circuit
If the parity addition bit of the serial control register HSC0CR is set to "1," data is sent with the parity bit. Note that the parity bit may be used only in the 7- or 8-bit UART mode. The bit of HSC0CR selects either even or odd parity. Upon data transmission, the parity control circuit automatically generates the parity with the data written to the send buffer (HSC0BUF). After data transmission is complete, the parity bit will be stored in HSC0BUF bit 7 in the 7-bit UART mode and in bit 7 in the serial mode control register HSC0MOD in the 8-bit UART mode. The and settings must be completed before data is written to the send buffer. Upon data reception, the parity bit for the received data is automatically generated while the data is shifted to receive buffer 1 and moved to receive buffer 2 (HSC0BUF). In the 7-bit UART mode, the parity generated is compared with the parity stored in HSC0BUF , while in the 8-bit UART mode, it is compared with the bit 7 of the HSC0CR register. If there is any difference, a parity error occurs and the flag of the HSC0CR register is set. In the I/O interface mode, the HSC0CR flag functions as an under-run error flag, not as a parity flag.
14.1.14 Error Flag
Three error flags are provided to increase the reliability of received data. 1. Overrun error : Bit 4 of the serial control register HSC0CR In both UART and I/O interface modes, this bit is set to "1" when an error is generated by completing the reception of the next frame receive data before the receive buffer has been read. If the receive FIFO is enabled, the received data is automatically moved to the receive FIFO and no overrun error will be generated until the receive FIFO is full (or until the usable bytes are fully occupied). This flag is set to "0" when it is read. In the I/O interface HSCLK output mode, no overrun error is generated and therefore, this flag is inoperative and the operation is undefined. 2. Parity error/under-run error : Bit 3 of the HSC0CR register In the UART mode, this bit is set to "1" when a parity error is generated. A parity error is generated when the parity generated from the received data is different from the parity received. This flag is set to "0" when it is read. In the I/O interface mode, this bit indicates an under-run error. When the double buffer control bit of the serial mode control register HSC0MOD2 is set to "1" in the HSCLK input mode, if no data is set to the transmit double buffer before the next data transfer clock after completing the transmission from the transmit shift register, this error flag is set to "1" indicating an under-run error. If the transmit FIFO is enabled, any data content in the transmit FIFO will be moved to the buffer. When the transmit FIFO and the double buffer are both empty, an under-run error will be generated. Because no under-run errors can be generated in the HSCLK output mode, this flag is inoperative and the operation is undefined. If send buffer 2 is disabled, the under-run flag will not be set. This flag is set to "0" when it is read.
TMP19A43(rev2.0) 14-15
Serial Channel (HSIO)
TMP19A43
3.
Framing error : Bit 2 of the HSC0CR register In the UART mode, this bit is set to "1" when a framing error is generated. This flag is set to "0" when it is read. A framing error is generated if the corresponding stop bit is determined to be "0" by sampling the bit at around the center. Regardless of the (stop bit length) setting of the serial mode control register 2, HSC0MOD2, the stop bit status is determined by only 1 bit on the receive side.
Operation mode UART Error flag OERR PERR FERR OERR PERR FERR OERR PERR FERR Function Overrun error flag Parity error flag Framing error flag Overrun error flag Underrun error flag (WBUF = 1) Fixed to 0 (WBUF = 0) Fixed to 0 Operation undefined Operation undefined Fixed to 0
I/O interface (HSCLK input)
I/O interface (HSCLK output)
TMP19A43(rev2.0) 14-16
Serial Channel (HSIO)
TMP19A43
14.1.15 Direction of Data Transfer
In the I/O interface mode, the direction of data transfer can be switched between "MSB first" and "LSB first" by the data transfer direction setting bit of the HSC0MOD2 serial mode control register 2. Don't switch the direction when data is being transferred.
14.1.16 Stop Bit Length
In the UART mode transmission, the stop bit length can be set to either 1 or 2 bits by bit 4 of the HSC0MOD2 register.
14.1.17 Status Flag
If the double buffer function is enabled (HSC0MOD2 = "1"), the bit 6 flag of the HSC0MOD2 register indicates the condition of receive buffer full. When one frame of data has been received and transferred from buffer 1 to buffer 2, this bit is set to "1" to show that buffer 2 is full (data is stored in buffer 2). When the receive buffer is read by CPU/DMAC, it is cleared to "0." If is set to "0," this bit is insignificant and must not be used as a status flag. When double buffering is enabled (HSC0MOD2 = "1"), the bit 7 flag of the HSC0MOD2 register indicates that send buffer 2 is empty. When data is moved from send buffer 2 to send buffer 1 (shift register), this bit is set to "1" indicating that send buffer 2 is now empty. When data is set to the send buffer by CPU/DMAC, the bit is cleared to "0." If is set to "0," this bit is insignificant and must not be used as a status flag.
14.1.18 Configurations of Send/Receive Buffers
WBUF = 0 UART I/O interface (HSCLK input) I/O interface (HSCLK output) Transmit buffer Receive buffer Transmit buffer Receive buffer Transmit buffer Receive buffer Single Double Single Double Single Single WBUF = 1 Double Double Double Double Double Double
14.1.19 software reset
Software reset is HSC0MOD2 "10" "01" HSC0MOD0RXEHSC0MOD1HSC0MOD2TBEMP,RBFLL,TXRUN HSC0CROERRPERRFERRand internal circuit is initialized. Other states are maintained.
TMP19A43(rev2.0) 14-17
Serial Channel (HSIO)
TMP19A43
14.1.20 Signal Generation Timing
UART Mode: Receive Side
Mode Interrupt generation timing Framing error timing 9-bit Around the center of the 1st stop bit Around the center of the stop bit 8-bit with parity Around the center of the 1st stop bit Around the center of the stop bit Around the center of the last (parity) bit Around the center of the stop bit 8-bit, 7-bit, and 7-bit with parity Around the center of the 1st stop bit Around the center of the stop bit Around the center of the last (parity) bit Around the center of the stop bit
Parity error generation timing Overrun error generation Around the center of timing the stop bit
Transmit Side
Mode Interrupt generation timing ( = 0) Interrupt generation timing ( = 1) 9-bit 8-bit with parity 8-bit, 7-bit, and 7-bit with parity Just before the stop bit is sent
Just before the stop bit Just before the stop bit is is sent sent Immediately after data is moved to send buffer 1 (just before start bit transmission) Immediately after data is moved to send buffer 1 (just before start bit transmission)
Immediately after data is moved to send buffer 1 (just before start bit transmission)
I/O interface mode: Receive Side
Interrupt generation HSCLK output mode Immediately after the rising edge of the last HSCLK timing HSCLK input mode Immediately after the rising or falling edge of the last HSCLK (WBUF = 0) (for rising or falling edge mode, respectively) Interrupt generation HSCLK output mode Immediately after the rising edge of the last HSCLK (just after timing data transfer to receive buffer 2) or just after receive buffer 2 is read (WBUF = 1) HSCLK input mode Immediately after the rising edge or falling edge of the last HSCLK depending on the rising or falling edge triggering mode, respectively (right after data is moved to receive buffer 2) Overrun error HSCLK input mode Immediately after the rising or falling edge of the last HSCLK generation timing (for rising or falling edge mode, respectively)
Transmit Side
Interrupt generation HSCLK output mode Immediately after the rising edge of the last HSCLK timing HSCLK input mode Immediately after the rising or falling edge of the last HSCLK (WBUF = 0) (for rising or falling edge mode, respectively) Interrupt generation HSCLK output mode Immediately after the rising edge of the last HSCLK or just timing after data is moved to send buffer 1 (WBUF = 1) HSCLK input mode Immediately after the rising or falling edge of the last HSCLK (for the rising or falling edge mode, respectively) or just after data is moved to send buffer 1 Under-run error HSCLK input mode Immediately after the falling or rising edge of the next HSCLK generation timing (for the rising or falling edge triggering mode, respectively)
Note 1) Do not modify any control register when data is being sent or received (in a state ready to send or receive). Note 2) Do not stop the receive operation (by setting HSC0MOD0="0") when data is being received. Note 3) Do not stop the transmit operation (by setting HSC0MOD1="0") when data is being transmitted. TMP19A43(rev2.0) 14-18
Serial Channel (HSIO)
TMP19A43
14.2
Register Description (Only for Channel 0)
7 bit Symbol TB8 0 Send data Bit 8 6 CTSE 0
Handshake function control 0: Disables CTS 1: Enables CTS
5 RXE 0 Receive control
4 WU
3 SM1
2 SM0
1 SC1
0 SC0
HSC0MOD0 Read/Write LITTLE (0xFFFF_E80E) After reset BIG (0xFFFF_E80D) Function
R/W 0 0 0 Wake-up Serial transfer mode function 00: I/O interface mode 0: Disables 0: Disable 01: 7-bit length reception UART mode 1: Enable 1: Enables 10: 8-bit length reception UART mode 11: 9-bit length UART mode
0 0 Serial transfer clock (for UART) 00: Timer TB0OUT 01: Baud rate generator 10: Internal fSYS clock 11: External clock (HSCLK0 input)
Note) In the I/O interface mode, the serial control register (HSC0CR) is used for clock selection. Wakeup function 9-bit UART 0 1 Interrupt when received Interrupt at RB8=1 Other mode don't care
Handshake function ( CTS pin) enable
0 1 Disable (transmission is always allowed) Enable
Note)
With set to "0," set each mode register (HSC0MOD0, HSC0MOD1 and HSC0MOD2). Then set to "1." * The registers must be byte accessed in setting them.
Fig. 14-10 Serial Mode Control Register 0 (for HSIO0, HSC0MOD0)
TMP19A43(rev2.0) 14-19
Serial Channel (HSIO)
TMP19A43
7 HSC0MOD1 LITTLE (0xFFFF_E805) BIG (0xFFFF_E806) bit Symbol Read/Write After reset Function I2S0 R/W 0 IDLE 0: Stop 1: Start
6 FDPX1
5 FDPX0
4 TXE R/W 0 Transmit control 0: Disable 1: Enable
3 SINT2
2 SINT1
1 SINT0
0 - R/W 0 Write "0."
R/W R/W 0 0 Transfer mode setting 00: Transfer prohibited 01: Half duplex (RX) 10: Half duplex (TX) 11: Full duplex
R/W R/W R/W 0 0 0 Interval time of continuous transmission 000: None 100: 8SCLK 001: 1SCLK 101:16SCLK 010: 2SCLK 110: 32SCLK 011: 4SCLK 111: 64SCLK
Fig. 14-11 Serial Mode Control Register 1 (for HSIO0, HSC0MOD1)
: Specifies the interval time of continuous transmission when double buffering or/and FIFO is enabled in the I/O interface mode. This parameter is invalid for the UART mode. This bit enables transmission and is valid for all the transfer modes. If disabled while transmission is in progress, transmission is inhibited only after the current frame of data is completed for transmission.
:
: Configures the transfer mode in the I/O interface mode. Also configures the FIFO if it is enabled. In the UART mode, it is used only to specify the FIFO configuration. : Specifies the Idle mode operation.
* The registers must be byte accessed in setting them.
TMP19A43(rev2.0) 14-20
Serial Channel (HSIO)
TMP19A43
7 LITTLE BIG HSC0MOD2 (0xFFFF_E806) (0xFFFF_E805) bit Symbol Read/Write After reset TBEMP 1 Send buffer empty flag 0: full 1: Empty
6 RBFLL 0 Receive buffer full flag 0: Empty 1: full
5 TXRUN R/W 0
In transmission flag
4 SBLEN 0 Stop bit 0: 1-bit 1: 2-bit
3 DRCHG 0 Setting transfer direction
0: LSB first 1: MSB first
2 WBUF 0 W-buffer 0: Disable 1: Enable
1 SWRST1
0 SWRST0
Function
0: Stop 1: Start
0 0 Soft reset Overwrite "01" on "10" to reset
: Overwriting "01" in place of "10" generates a software reset. When this software reset is executed, the mode register parameters HSC0MOD0 , HSC0MOD1, HSC0MOD2 , , and , control register parameters HSC0CR , , and , and their internal circuits are initialized. : This parameter enables or disables the send/receive buffers to send (in both HSCLK output/input modes) and receive (in HSCLK output mode) data in the I/O interface mode and to transmit data in the UART. In all other modes, double buffering is enabled regardless of the setting. Specifies the direction of data transfer in the I/O interface mode. In the UART mode, it is fixed to LSB first. This is a status flag to show that data transmission is in progress. When this bit is set to "1," it indicates that data transmission operation is in progress. If it is "0," the bit 7 is set to "1" to indicate that the transmission has been fully completed and the same is set to "0" to indicate that the send buffer contains some data waiting for the next transmission. This is a flag to show that the receive double buffers are full. When a receive operation is completed and received data is moved from the receive shift register to the receive double buffers, this bit changes to "1" while reading this bit changes it to "0." If double buffering is disabled, this flag is insignificant. This flag shows that the send double buffers are empty. When data in the send double buffers is moved to the send shift register and the double buffers are empty, this bit is set to "1." Writing data again to the double buffers sets this bit to "0." If double buffering is disabled, this flag is insignificant. This specifies the length of stop bit transmission in the UART mode. On the receive side, the decision is made using only a single bit regardless of the setting.
: :
:
:
:
(Note)
While data transmission is in progress, any software reset operation must be executed twice in succession.
* The registers must be byte accessed in setting them.
Fig. 14-12 Serial Mode Control Register
TMP19A43(rev2.0) 14-21
Serial Channel (HSIO)
TMP19A43
7 HSC0CR LITTLE (0xFFFF_E80D) Read/Write BIG (0xFFFF_E80E) After reset Function bit Symbol RB8 R 0 Receive data Bit 8
6 EVEN
5 PE R/W 0 Add parity 0: Disable 1: Enable
4 OERR
3 PERR
2 FERR
1 SCLKS
0 IOC R/W 0 0
0: Baud rate generator 1: HSCLK0 pin input
0 Parity 0: Odd 1: Even
R (cleared to "0" when read) 0 0 0 1: Error Overrun Parity/ under-run Framing
0: HSCLK0
1: HSCLK0
I/O interface input clock selection 0 Baud rate generator 1 HSCLK0 pin input
Edge selection for HSCLK0 input operation 0 Data send/receive at rising edges of HSCLK0 1 Data send/receive at falling edges of HSCLK0 Cleared to "0" when read
Framing error flag Parity error/under-run error flag Overrun error flag
Add/check even parity 0 1 Odd parity Even parity
(Note)
Any error flag is cleared when read.
* The registers must be byte accessed in setting them.
Fig. 14-13 Serial Control Register (for HSIO0, HSC0CR)
TMP19A43(rev2.0) 14-22
Serial Channel (HSIO)
TMP19A43
7 bit Symbol HBR0CR LITTLE (0xFFFF_E80F) Read/Write BIG (0xFFFF_E80C) After reset - 0 Write "0."
6 HBR0ADDE 0
N+(16-K)/16 divider function
5 HBR0S5 0
4 HBR0S4 0 R/W
3 HBR0S3
2 HBR0S2
1 HBR0S1 0
0 HBR0S0 0
0 0 Divide ratio "N"
Function
0: Disable 1: Enable
* The registers must be byte accessed in setting them.
7 HBR0ADD LITTLE (0xFFFF_E804) BIG (0xFFFF_E807) bit Symbol Read/Write After reset
6 R 0
5
4
3 HBR0K3 0
2
1
0 HBR0K0 0
HBR0K2 HBR0K1 R/W 0 0
Always reads "0." Specify K for the "N + (16 - K)/16" division Function
~
Setting divide ratio of the baud rate generator HBR0CR = 1 HBR0CR 000000(N = 64) 000010(N = 2)
~
HBR0CR = 0 000001(N = 1) (ONLY UART) 111111 (N = 63) 000000 (N = 64)
~
HBR0DD 0000 0001(K = 1) 1111(K = 15)
~
0001(N = 1) Disable Disable
111111(N = 63) Disable N+ (16 - K) Division
16
Divide by N
Fig. 14-14 Baud Rate Generator Control (for HSIO0, HBR0CR, HBR0ADD) (Note 1) In the UART mode, the division ratio "1" of the baud rate generator can be specified only when the "N + (16 - K)/16" division function is not used. In the I/O interface mode, "divide by 1" must not be specified as a divisor for the baud rate generator. (Note 2) To use the "N + (16 - K)/16" division function, be sure to set HBR0CR to "1" after setting the K value (K = 1 to 15) to HBR0ADD . However, don't use the "N + (16 - K)/16" division function when HBR0CR is set to either "000000" or "000001" (N = 64 or 1). (Note 3) The "N + (16 - K)/16" division function can only be used in the UART mode. In the I/O interface mode, the "N + (16 - K)/16" division function must be disabled (prohibited) by setting HBR0CR to "0."
TMP19A43(rev2.0) 14-23
Serial Channel (HSIO)
TMP19A43
7 TB7
6 TB6
5 TB5
4 TB4
3 TB3
2 TB2
1 TB1
0 TB0 (Send BUFFER FIFO)
LITTLE BIG
HSC0BUF (0xFFFF_E800) (0xFFFF_E803)
7 RB7
6 RB6
5 RB5
4 RB4
3 RB3
2 RB2
1 RB1
0 RB0 (Receive BUFFER FIFO)
Note:
HSC0BUF works as a send buffer for WR operation and as a receive buffer for RD operation. Fig. 14-15 FIFO Configuration Register
7 bit Symbol Reserved Read/Write After reset 6 Reserved 5 Reserved 4 RFST R/W
Bytes used in RX FIFO 0: Maximum 1: Same as Fill level of RX FIFO
3 TFIE
TX interrupt for TX FIFO
2 RFIE
1 RXTXCNT 0
0 CNFG 0
FIFO Enable 0: Disable 1: Enable
LITTLE BIG
HSC0FCNF (0xFFFF_E80C) (0xFFFF_E80F)
Function
Be sure to write "000."
0: Disable 1: Enable
RX interrupt Automatic for RX FIFO disable of 0: Disable RXE/TXE 0: None 1: Enable 1: Auto Disable
: If enabled, the HSCOMOD1 setting automatically configures FIFO as follows: = 01 (Half duplex RX) ---- 4-byte RX FIFO = 10 (Half duplex TX) ---- 4-byte TX FIFO = 11 (Full duplex) ---- 2-Byte RX FIFO + 2-Byte TX FIFO
:0 The function to automatically disable RXE/TXE bits is disabled. 1: If enabled, the HSCOMOD1 is used to set as follows: = 01 (Half duplex RX) ------ When the RX FIFO is filled up to the specified number of valid bytes, RXE is automatically set to "0" to inhibit further reception. = 10 (Half duplex TX) ------ When the TX FIFO is empty, TXE is automatically set to "0" to inhibit further transmission. = 11 (Full duplex) ----------- When either of the above two conditions is satisfied, TXE/RXE are automatically set to "0" to inhibit further transmission and reception. : When RX FIFO is enabled, receive interrupts are enabled or disabled by this parameter. : When TX FIFO is enabled, transmit interrupts are enabled or disabled by this parameter. : When RX FIFO is enabled, the number of RX FIFO bytes to be used is selected. 0: The maximum number of bytes of the FIFO configured 4 bytes when = 01 (Half duplex RX) and 2 bytes for = 11 (Full duplex) 1: Same as the fill level for receive interrupt generation specified by SC0RFC .
(Note 1) Regarding TX FIFO, the maximum number of bytes being configured is always available. The available number of bytes is the bytes already written to the TX FIFO. * The registers must be byte accessed in setting them. TMP19A43(rev2.0) 14-24 Serial Channel (HSIO)
TMP19A43
Fig. 14-16 Receive FIFO Control Register
7 bit Symbol Read/Write HSC0RFC LITTLE (0xFFFF_E808) BIG (0xFFFF_E80B) After reset RFCS 0 Clear RX FIFO 1: Clear Always reads "0." 0 Select interrupt generation condition 0 0 Always reads "0." 6 RFIS 5 - 4 - 3 - R 0 2 - 0 1 RIL1 0 RIL0
0 0 FIFO fill level to generate RX interrupts 01: 1byte 10: 2byte 11: 3byte Note: RIL1 is ignored when FDPX1:0 = 11 (full duplex)
Function
0: An interrupt is generated when the specified fill level is reached. 1: An interrupt is generated when the specified fill level is reached or if the specified fill level has been exceeded at the time data is read.
Fig. 14-17 Transmit FIFO Configuration Register
7 bit Symbol Read/Write HSC0TFC LITTLE (0xFFFF_E809) BIG (0xFFFF_E80A) After reset TFCS 0 Clear TX FIFO 1: Clear Always reads "0." 0 Select interrupt generation condition 0 0 Always reads "0." 6 TFIS 5 - 4 - 3 - R 0 2 - 0 1 TIL1 0 TIL0
0 0 FIFO fill level to generate TX interrupts 00: Empty 01: 1byte 10: 2byte 11: 3byte Note: TIL1 is ignored when FDPX1:0 = 11 (full duplex).
Function
0: An interrupt is generated when the specified fill level is reached. 1: An interrupt is generated when the specified fill level is reached or if the level is lower than the specified fill level at the time new data is written. * The registers must be byte accessed in setting them.
TMP19A43(rev2.0) 14-25
Serial Channel (HSIO)
TMP19A43
Fig. 14-18 Receive FIFO Status Register
7 bit Symbol Read/Write After reset ROR R 0 RX FIFO Overrun Function
1: Generated
6
5
4
3 R 0
2 RLVL2
1 RLVL1 0
0 RLVL0 0
LITTLE BIG
HSC0RST (0xFFFF_E80A) (0xFFFF_E809)
0
0
0
0
Always reads "0."
Cleared when read
Status of RX FIFO fill level 000: Empty 001: 1Byte 010: 2Byte 011: 3Byte 100: 4Byte
Fig. 14-19 Transmit FIFO Status Register
7 bit Symbol HSC0TST LITTLE (0xFFFF_E80B) BIG (0xFFFF_E808) Read/Write After reset TUR R 1 TX FIFO Under run
1: Generated
6
5
4
3 R 0
2 TLVL2
TLVL1
0 TLVL0 0
0 0 Always reads "0."
0
Function
Cleared by writing to FIFO
0 0 Status of TX FIFO fill level 000: Empty 001: 1Byte 010: 2Byte 011: 3Byte 100: 4Byte
Fig. 14-20 HSIO Enable Register
7 bit Symbol Read/Write LITTLE BIG HSC0EN (0xFFFF_E807) (0xFFFF_E804) After reset 0 0 Always reads "0." 0 - 6 - 5 - 4 - R 0 3 - 0 2 - 0 1 - 0 0 SIOE R/W 0 HSIO operation 0: Disable 1: Enable
Function
: It specifies HSIO operation. When HSIO operation is disabled, the clock will not be supplied to the HSIO module except for the register part and thus power dissipation can be reduced (other registers cannot be accessed for read/write operation). When HSIO is to be used, be sure to enable HSIO by setting "1" to this register before setting any other registers of the HSIO module. If HSIO is enabled once and then disabled, any register setting is maintained.
* The registers must be byte accessed in setting them.
TMP19A43(rev2.0) 14-26
Serial Channel (HSIO)
TMP19A43
14.3
14.3.1
Operation in Each Mode
Mode 0 (I/O Interface Mode)
Mode 0 consists of two modes, i.e., the "HSCLK output" mode to output synchronous clock and the "HSCLK input" mode to accept synchronous clock from an external source. The following operational descriptions are for the case use of FIFO is disabled. For details of FIFO operation, refer to the previous sections describing receive/transmit FIFO functions. Sending data HSCLK output mode In the HSCLK output mode, if HSC0MOD2 is set to "0" and the send double buffers are disabled, 8 bits of data are output from the HXD0 pin and the synchronous clock is output from the HSCLK0 pin each time the CPU writes data to the send buffer. When all data is output, the HINTTX0 interrupt is generated. If HSC0MOD2 is set to "1" and the send double buffers are enabled, data is moved from send buffer 2 to send buffer 1 when the CPU writes data to send buffer 2 while data transmission is halted or when data transmission from send buffer 1 (shift register) is completed. When data is moved from send buffer 2 to send buffer 1, the send buffer empty flag HSC0MOD2 is set to "1," and the HINTTX0 interrupt is generated. If send buffer 2 has no data to be moved to send buffer 1, the HINTTX0 interrupt is not generated and the HSCLK0 output stops.
Transmit data write timing HSCLK0 output
HTXD0 (HINTTX0 interrupt
HTXRUN
bit 0
bit 1
bit 6
bit 7
bit 0
= "0" (if double buffering is disabled)
TMP19A43(rev2.0) 14-27
Serial Channel (HSIO)
TMP19A43
Transmit data write timing HCLK0 output HTXD
(HINTTX0 interrupt request)
bit 0
bit 1
bit 6
bit 7
bit 0
TBRUN TBEMP
= "1" (if double buffering is enabled) (if there is data in buffer 2)
Transmit data write timing SCLK0 output HTXD0
(HINTTX0 interrupt request)
bit 0
bit 1
bit 6
bit 7
TBRUN TBEMP
= "1" (if double buffering is enabled) (if there is no data in buffer 2)
Fig. 14-21 Send Operation in the I/O Interface Mode (HSCLK0 Output Mode)
HSCLK input mode In the HSCLK input mode, if HSC0MOD2 is set to "0" and the send double buffers are disabled, 8-bit data that has been written in the send buffer is output from the HTXD0 pin when the HSCLK0 input becomes active. When all 8 bits are sent, the HINTTX0 interrupt is generated. The next send data must be written before the timing point "A." If HSC0MOD2 is set to "1" and the send double buffers are enabled, data is moved from send buffer 2 to send buffer 1 when the CPU writes data to send buffer 2 before the HSCLK0 becomes active or when data transmission from send buffer 1 (shift register) is completed. As data is moved from send buffer 2 to send buffer 1, the send buffer empty flag HSC0MOD2 is set to "1" and the HINTTX0 interrupt is generated. If the HSCLK0 input becomes active while no data is in send buffer 2, although the internal bit counter is started, an under-run error occurs and 8-bit dummy data (FFh) is sent.
TMP19A43(rev2.0) 14-28
Serial Channel (HSIO)
TMP19A43
Transmit data write timing HSCLK0 input (=0 rising edge mode) HSCLK0 input (=1 falling edge mode) HTXD0 (HINTTX0 interrupt request) bit 0 bit 1 bit 5 bit 6 bit 7
A
bit 0
bit 1
= "0" (if double buffering is disabled)
Transmit data write timing HSCLK0 input (=0 rising edge mode) HSCLK0 input (=1 falling edge mode) HTXD0 (HINTTX0 interrupt request) TBRUN TBEMP bit 0 bit 1 bit 5 bit 6 bit 7
A
bit 0
bit 1
= "1" (if double buffering is enabled) (if there is data in buffer 2)
Transmit data write timing HSCLK0 input (=0 rising edge mode) HSCLK0 input (=1 falling edge mode) HTXD0 (HNTTX0 interrupt request) TBRUN TBEMP
PERR (functions to detect under-run errors)
A
bit 0
bit 1
bit 5
bit 6
bit 7
1
= "1" (if double buffering is enabled) (if there is no data in buffer 2)
Fig. 14-22 Send Operation in the I/O Interface Mode (HSCLK0 Input Mode)
TMP19A43(rev2.0) 14-29
Serial Channel (HSIO)
TMP19A43
Receiving data HSCLK output mode In the HSCLK output mode, if HSC0MOD2 = "0" and receive double buffering is disabled, a synchronous clock pulse is output from the HSCLK0 pin and the next data is shifted into receive buffer 1 each time the CPU reads received data. When all the 8 bits are received, the HINTRX0 interrupt is generated. The first HSCLK output can be started by setting the receive enable bit HSC0MOD0 to "1." If the receive double buffering is enabled with HSC0MOD2 set to "1," the first frame received is moved to receive buffer 2 and receive buffer 1 can receive the next frame successively. As data is moved from receive buffer 1 to receive buffer 2, the receive buffer full flag HSC0MOD2 is set to "1" and the HINTRX0 interrupt is generated. While data is in receive buffer 2, if CPU/DMAC cannot read data from receive buffer 2 in time before completing reception of the next 8 bits, the HINTRX0 interrupt is not generated and the HSCLK0 clock stops. In this state, reading data from receive buffer 2 allows data in receive buffer 1 to move to receive buffer 2 and thus the HINTRX0 interrupt is generated and data reception resumes.
Receive data write timing HSCLK0 output HRXD0 (HINTRX0 interrupt request) bit 0 bit 1 bit 6 bit 7 bit 0
= "0" (if double buffering is disabled)
Receive data read timing HSCLK0 output HRXD0 bit 7 bit 0 bit 1 bit 6 bit 7 bit 0
(HINTRX0 interrupt request)
RBFULL
= "1" (if double buffering is enabled) (if data is read from buffer 2)
TMP19A43(rev2.0) 14-30
Serial Channel (HSIO)
TMP19A43
Receive data read timing HSCLK0 output HRXD0 bit 7 bit 0 bit 1 bit 6 bit 7
(HINTRX0 interrupt request)
RBFULL
= "1" (if double buffering is enabled) (if data cannot be read from buffer 2)
Fig. 14-23 Receive Operation in the I/O Interface Mode (HSCLK0 Output Mode)
HSCLK input mode In the HSCLK input mode, since receive double buffering is always enabled, the received frame can be moved to receive buffer 2 and receive buffer 1 can receive the next frame successively. The HINTRX0 receive interrupt is generated each time received data is moved to received buffer 2.
Receive data read timing HSCLK0 input (=0 rising edge mode) HSCLK0 input (=1 falling edge mode) HRXD0 (HNTRX0 interrupt request) RBFULL bit 0 bit 1 bit 5 bit 6 bit 7 bit 0
If data is read from buffer 2
Receive data read timing HSCLK0 input (=0 rising edge mode) HSCLK0 input (=1 falling edge mode) HRXD0 (HINTRX0 interrupt request) RBFULL OERR bit 0 bit 1 bit 5 bit 6 bit 7 bit 0
If data cannot be read from buffer 2
Fig. 14-24 Receive Operation in the I/O Interface Mode (HSCLK0 Input Mode) (Note) To receive data, HSC0MOD must always be set to "1" (receive enable) regardless of the HSCLK input or output mode.
TMP19A43(rev2.0) 14-31
Serial Channel (HSIO)
TMP19A43
Send and receive (full-duplex) The full-duplex mode is enabled by setting bit 6 of the serial mode control register 1 (HSC0MOD1) to "1." HSCLK output mode In the HSCLK output mode, if HSC0MOD2 is set to "0" and both the send and receive double buffers are disabled, HSCLK is output when the CPU writes data to the send buffer. Subsequently, 8 bits of data are shifted into receive buffer 1 and the HINTRX0 receive interrupt is generated. Concurrently, 8 bits of data written to the send buffer are output from the HTXD0 pin, the HINTTX0 send interrupt is generated when transmission of all data bits has been completed. Then, the HSCLK output stops. In this, the next round of data transmission and reception starts when the data is read from the receive buffer and the next send data is written to the send buffer by the CPU. The order of reading the receive buffer and writing to the send buffer can be freely determined. Data transmission is resumed only when both conditions are satisfied. If HSC0MOD2 = "1" and double buffering is enabled for both transmission and reception, HSCLK is output when the CPU writes data to the send buffer. Subsequently, 8 bits of data are shifted into receive buffer 1, moved to receive buffer 2, and the HINTRX0 interrupt is generated. While 8 bits of data is received, 8 bits of transmit data is output from the HTXD0 pin. When all data bits are sent out, the HINTTX0 interrupt is generated and the next data is moved from the send buffer 2 to send buffer 1. If send buffer 2 has no data to be moved to send buffer 1 (HSC0MOD2 = 1) or when receive buffer 2 is full (HSC0MOD2 = 1), the HSCLK clock is stopped. When both conditions are satisfied, i.e., receive data is read and send data is written, the HSCLK output is resumed and the next round of data transmission is started.
Receive data read timing Transmit data write timing HSCLK0 output HTXD0 HRXD0 (HINTTX0 interrupt request) (HINTRX0 interrupt request) bit 0 bit 0 bit 1 bit 1 bit 5 bit 5 bit 6 bit 6 bit 7 bit 7 bit 0 bit 0 bit 1 bit 1
= "0" (if double buffering is disabled)
TMP19A43(rev2.0) 14-32
Serial Channel (HSIO)
TMP19A43
Receive data read timing Transmit data write timing HSCLK0 output HTXD0 HRXD0 (HINTTX0 interrupt request) (HINTRX0 interrupt request) bit 0 bit 0 bit 1 bit 1 bit 5 bit 5 bit 6 bit 6 bit 7 bit 7 bit 0 bit 0 bit 1 bit 1
= "1" (if double buffering is enabled)
Receive data read timing Transmit data write timing HSCLK0 output HTXD0 HRXD0 (HINTTX0 interrupt request) (HINTRX0 interrupt request) bit 0 bit 0 bit 1 bit 1 bit 5 bit 5 bit 6 bit 6 bit 7 bit 7
= "1" (if double buffering is enabled)
Fig. 14-25 Send/Receive Operation in the I/O Interface Mode (HSCLK0 Output Mode)
HSCLK input mode In the HSCLK input mode with HSC0MOD2 set to "0" and the send double buffers are disabled (double buffering is always enabled for the receive side), 8-bit data written in the send buffer is output from the HTXD0 pin and 8 bits of data is shifted into the receive buffer when the HSCLK input becomes active. The HINTTX0 interrupt is generated upon completion of data transmission and the HINTRX0 interrupt is generated at the instant the received data is moved from receive buffer 1 to receive buffer 2. Note that transmit data must be written into the send buffer before the HSCLK input for the next frame (data must be written before the point A). As double buffering is enabled for data reception, data must be read before completing reception of the next frame data. If HSC0MOD2 = "1" and double buffering is enabled for both transmission and reception, the interrupt HINTRX0 is generated at the timing send buffer 2 data is moved to send buffer 1 after completing data transmission from send buffer 1. At the same time, the 8 bits of data received is shifted to buffer 1, moved to receive buffer 2, and the HINTRX0 interrupt is generated. Upon the HSCLK input for the next frame, transmission from send buffer 1 (in which data has been moved from send buffer 2) is started while receive data is shifted into receive buffer 1 simultaneously. If data in receive buffer 2 has not been read when the last bit of the frame is received, an overrun error occurs. Similarly, if there is no data written to send buffer 2 when HSCLK for the next frame is input, an under-run error occurs.
TMP19A43(rev2.0) 14-33
Serial Channel (HSIO)
TMP19A43
Receive data read timing Transmit data write timing HSCLK0 inout
HTXD0 HRXD0 (HINTTX0 interrupt request) (HINTRX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
= "0" (if double buffering is disabled)
Receive data read timing Transmit data write timing HSCLK0 input
HTXD0 HRXD0 (HINTTX0 interrupt request) (HINTRX0 interrupt request)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
= "1" (if double buffering is enabled) (no errors)
TMP19A43(rev2.0) 14-34
Serial Channel (HSIO)
TMP19A43
Receive data read timing Transmit data write timing HSCLK0 input
HTXD0 HRXD0 (HINTTX0 interrupt request) (HINTRX0 interrupt request) PERR (under-run error)
bit 0 bit 0
bit 1 bit 1
bit 5 bit 5
bit 6 bit 6
bit 7 bit 7
bit 0 bit 0
bit 1 bit 1
= "1" (if double buffering is enabled) (error generation)
Fig. 14-26 Send/Receive Operation in the I/O Interface Mode (HSCLK0 Input Mode)
TMP19A43(rev2.0) 14-35
Serial Channel (HSIO)
TMP19A43
14.3.2
Mode 1 (7-bit UART Mode)
The 7-bit UART mode can be selected by setting the serial mode control register (HSC0MOD ) to "01." In this mode, parity bits can be added to the transmit data stream; the serial mode control register (HSC0CR ) controls the parity enable/disable setting. When is set to "1" (enable), either even or odd parity may be selected using the HSC0CR bit. The length of the stop bit can be specified using HSC0MOD2.
14.3.3
Mode 2 (8-bit UART Mode)
The 8-bit UART mode can be selected by setting HSC0MOD0 to "10." In this mode, parity bits can be added and parity enable/disable is controlled using HSC0CR . If = "1" (enabled), either even or odd parity can be selected using HSC0CR .
14.3.4
Mode 3 (9-bit UART)
The 9-bit UART mode can be selected by setting HSC0MOD0 to "11." In this mode, parity bits must be disabled (HSC0CR = "0"). The most significant bit (9th bit) is written to bit 7 of the serial mode control register 0 (HSC0MOD0) for transmit data and it is stored in bit 7 of the serial control register HSC0CR upon receiving data. When writing or reading data to/from the buffers, the most significant bit must be written or read first before writing or reading to/from HSC0BUF. The stop bit length can be specified using HSC0MOD2 . Wakeup function In the 9-bit UART mode, slave controllers can be operated in the wake-up mode by setting the wake-up function control bit HSC0MOD0 to "1." In this case, the interrupt HINTRX0 will be generated only when HSC0CR is set to "1."
HTXD
HRXD
HTXD
HRXD
HTXD
HRXD
HTXD
HRXD
Master
Slave 1
Slave 2
Slave 3
(Note)
The HTXD pin of the slave controller must be set to the open drain output mode using the ODE register. Fig. 14-27 Serial Links to Use Wake-up Function
TMP19A43(rev2.0) 14-36
Serial Channel (HSIO)
TMP19A43
Protocol Select the 9-bit UART mode for the master and slave controllers. Set HSC0MOD to "1" for the slave controllers to make them ready to receive data. The master controller is to send a single frame of data that includes the slave controller select code (8 bits). In this, the most significant bit (bit 8) must be set to "1."
start
bit 0
1
2
3
4
5
6
7
8 "1"
stop
Slave controller select code
Every slave controller receives the above data frame; if the code received matches with the controller's own select code, it clears the WU bit to "0." The master controller transmits data to the designated slave controller (the controller of which HSC0MOD bit is cleared to "0"). In this, the most significant bit (bit 8) must be set to "0."
start
bit 0
1
2
3 data
4
5
6
7
bit 8 "0"
stop
The slave controllers with the bit set to "1" ignore the receive data because the most significant bit (bit 8) is set to "0" and thus no interrupt (HINTRX0) is generated. Also, the slave controller with the bit set to "0" can transmit data to the master controller to inform that the data has been successfully received. Example setting: Using the internal clock fSYS as the transfer clock, two slave controllers are serially linked as follows:
HTXD
HRXD
HTXD
HRXD
HTXD
HRXD
Master
Slave 1 Select code 00000001
Slave 2 Select code 00001010
TMP19A43(rev2.0) 14-37
Serial Channel (HSIO)
TMP19A43
15. Serial Bus Interface (SBI)
The TMP19A43 contains a Serial Bus Interface (SBI) channel, which has the following two operating modes: * * I C bus mode (with multi-master capability) Clock-synchronous 8-bit SIO mode
2 2
In the I C bus mode, the SBI is connected to external devices via PC5 (SDA) and PC7 (SCL). In the clocksynchronous 8-bit SIO mode, the SBI is connected to external devices via PC7 (SCK), PC5 (SO) and PC6 (SI). The following table shows the programming required to put the SBI in each operating mode.
PCODE PCCR PCFC
I2C bus mode Clock-synchronous 8-bit SIO mode X: Don't care
11 XX
X11 101 (clock output) 001 (clock input)
011 111
15.1 Configuration
The configuration is shown in Fig. 15.1.
INTS0 interrupt request SCL SCK SIO clock control Input/ output control SIO Transfer control circuit data control PC5 SO SI (SO/SDA) PC7 (SCK)
fsys/4
Frequency divider
2
Noise canceller
I C bus clock synchronization + control
PC6 Shift register I C bus data control
2
(SI/SCL) Noise canceller SDA
SBICR2/ SBISR SBI control register 2/ SBI status register
2
I2CAR I C bus address register
SBIDBR SBI data buffer register
SBICR0,1
SBIBR0
SBI control registers SBI baud rate register 0 0 and 1
Fig. 15.1 SBI Block Diagram
TMP19A43(rev2.0) 15-1
Serial Bus Interface (SBI)
TMP19A43
15.2 Control
The following registers control the serial bus interface and provide its status information for monitoring. * * * * * * * Serial bus interface control register 0 (SBICR0) Serial bus interface control register 1 (SBICR1) Serial bus interface control register 2 (SBICR2) Serial bus interface buffer register (SBIDBR) I2C bus address register (I2CAR) Serial bus interface status register (SBISR) Serial bus interface baud rate register 0 (SBIBR0)
The functions of these registers vary, depending on the mode in which the SBI is operating. For a detailed 2 description of the registers, refer to "3.12.4 Control in the I C Bus Mode" and "3.12.7 Control in the Clocksynchronous 8-bit SIO Mode."
15.3 I2C Bus Mode Data Formats
Fig. 15.1 shows the data formats used in the I2C bus mode.
(a)
Addressing format 8 bits S
Slave address
1 RA /C WK
1 to 8 bits
Data
1 A C K Repeated
1 to 8 bits
Data
1 A CP K
Once
(b)
Addressing format (with repeated start condition) 8 bits S
Slave address
1 RA /C WK
1 to 8 bits
Data
1 A CS K
8 bits
Slave address
1 RA /C WK
1 to 8 bits
Data
1 A CP K
Once
Repeated
Once
Repeated
(c)
Free data format (master-transmitter to slave-receiver) 8 bits S
Data
1 A C K
1 to 8 bits
Data
1 A C K
1 to 8 bits
Data
1 A CP K
Once
Repeated
Note:
S: R/W : ACK: P:
Start condition Direction bit Acknowledge bit Stop condition
Fig. 15.2 I2C Bus Mode Data Formats
TMP19A43(rev2.0) 15-2
Serial Bus Interface (SBI)
TMP19A43
15.4 Control Registers in the I2C Bus Mode
The following registers control the serial bus interface (SBI) in the I2C bus mode and provide its status information for monitoring. Serial bus interface control register 0
7 Bit symbol SBICR0 Read/Write (0xFFFF_F257) After reset Function SBIEN R/W 0 SBI operation 0: Disable 1: Enable R 0 This can be read as "0." 6 5 4 3 2 1 0
: To use the SBI, enable the SBI operation ("1") before setting each register in the SBI module. Fig. 15.3 I2C Bus Mode Register
TMP19A43(rev2.0) 15-3
Serial Bus Interface (SBI)
TMP19A43
Serial bus interface control register 1
7 Bit symbol SBICR1 (0xFFFF_F250) Read/Write After reset Function BC2 6 BC1 R/W 0 5 BC0 4 ACK R/W 0 Acknowledgment clock
0: Not generate 1: Generate
3
2 SCK2
1 SCK1 R/W
0
SCK0/ SWRMON
0
0
R 1
0
0
R/W 1
Select the number of bits per transfer (Note 1)
This can Select internal SCL output clock be read as frequency (Note 2) and reset "1." monitor
On writing : Select internal SCL output clock frequency 000 n=5 196 kHz 001 n=6 149 kHz System clock : fsys (=40 MHz) 010 n=7 101 kHz Clock gear : fc/1 011 n=8 61 kHz fsys/2 100 n=9 34 kHz Frequency = [Hz] n 2 + 70 101 n=10 18 kHz kHz 110 n=11 9 reserved 111 On reading : Software reset status monitor 0 Software reset operation is in progress. 1 Software reset operation is not in progress. Select the number of bits per transfer 000 001 010 011 100 101 110 111 When = 0 Number of Data clock cycles length 8 8 1 1 2 2 3 3 4 4 5 5 6 6 7 7 When = 1 Number of Data clock cycles length 9 8 2 1 3 2 4 3 5 4 6 5 7 6 8 7
(Note 1) Clear to "000" before switching the operation mode to the clock-synchronous 8-bit SIO mode. (Note 2) For details on the SCL line clock frequency, refer to "3.12.5 (3) Serial Clock." (Note 3) After a reset, the bit is read as "1." However, if the SIO mode is selected at the SBICR2 register, the initial value of the bit is "0." Fig. 15.4 I2C Bus Mode Register
TMP19A43(rev2.0) 15-4
Serial Bus Interface (SBI)
TMP19A43
Serial bus interface control register 2
7 Bit symbol SBICR2 Read/Write (0xFFFF_F253) After reset Function MST 0
Select master/slave 0: Slave 1: Master
6 TRX W 0
Select transmit/ receive 0: Receive 1: Transmit
5 BB 0
Start/stop condition generation 0: Stop condition generated 1: Start condition generated
4 PIN 1
3
2
1
0
SBIM1 SBIM0 W (Note 1) 0 0
SWRST1 SWRST0 W (Note 1) 0 0
Software reset generation Write "10" followed by "01" to generate a reset.
Clear INTS0 Select serial bus interface operating mode interrupt (Note 2) request 00: Port mode 0: - 01: SIO mode 1: Clear 10: I2C bus mode interrupt 11: (Reserved) request
Select serial bus interface operating mode (Note 2) 00 Port mode (Serial bus interface output disabled) 01 Clock-synchronous 8-bit SIO mode 10 I2C bus mode 11 (Reserved)
(Note 1) Reading this register causes it to function as the SBISR register. (Note 2) Ensure that the bus is free before switching the operating mode to the port mode. Ensure that the port is at the "H" level before switching the operating mode from the port mode to the I2C bus or clock-synchronous 8-bit SIO mode. (Note 3) Ensure that serial transfer is completed before switching the mode. Fig. 15.5 I2C Bus Mode Register
Table 15.1 Base Clock Resolution
@fsys = 40 MHz Clock gear value 00 (fc) 01 (fc/2) 10 (fc/4) 11 (fc/8) Base clock resolution fsys/22 (0.1 s) fsys/23 (0.2 s) fsys/24 (0.4 s) fsys/25 (0.8 s)
TMP19A43(rev2.0) 15-5
Serial Bus Interface (SBI)
TMP19A43
Serial bus interface status register
7 Bit symbol SBISR Read/Write (0xFFFF_F253) After reset Function MST 0 Master/ slave selection monitor 0: Slave 1: Master 6 TRX 0 Transmit/ receive selection monitor 0: Receive 1: Transmit
2
5 BB 0 I C bus state monitor 0: Free 1: Busy
4 PIN R 1 INTS0 interrupt request monitor
0: Interrupt request generated 1: Interrupt request cleared
3 AL 0 Arbitration lost detection 0: - 1: Detected
2 AAS 0 Slave address match detection 0: - 1: Detected
1 AD0 0 General call detection 0: - 1: Detected
0 LRB 0 Last received bit monitor 0: "0" 1: "1"
Last received bit monitor 0 The last bit received was "0." 1 The last bit received was "1." Addressed as slave 0 1 - Addressed as slave or general call detected - Arbitration was lost to another master
Arbitration lost 0 1
(Note)
Writing to this register causes it to function as SBICR2. Fig. 15.6 I2C Bus Mode Register
TMP19A43(rev2.0) 15-6
Serial Bus Interface (SBI)
TMP19A43
Serial bus interface baud rate register 0
7 Bit symbol SBIBR0 Read/Write (0xFFFF_F254) After reset Function R 1 6 I2SBI0 R/W 0 5 4 3 R 1 2 1 0 R/W 0 Make sure that you write "0." (Note)
This can IDLE This can be read as "1." be read as 0: Stop "1." 1: Operate
Operation in the IDLE mode 0 Stop 1 Operate
(Note)
This is read as "1" in the SIO mode.
Serial bus interface data buffer register
7 Bit symbol SBIDBR Read/Write (0xFFFF_F251) After reset DB7 6 DB6 5 DB5 4 3 2 DB2 1 DB1 0 DB0 DB4 DB3 R (Receive)/W (Transmit) 0
(Note)
Transmit data must be written to this register, with bit 7 being the most-significant bit (MSB).
I2C bus address register
7 Bit symbol I2CAR Read/Write (0xFFFF_F252) After reset Function SA6 6 SA5 5 SA4 4 SA3 3 SA2 2 SA1 0 1 SA0 0 0 ALS 0 Specify address recognition mode
R/W 0 0 0 0 0 Set the slave address when the SBI acts as a slave device.
Specify address recognition mode 0 Recognizes the slave address. 1 Does not recognize slave address.
Fig. 15.7I2C Bus Mode Register
(Note) Please set the bit of I2C bus address register I2CAR to "0" about 0< ALS >, except when you use the free data format. It operates as a free data format when setting it to "1", it fixes to the transmission at the master, and the direction of forwarding is fixed to the reception at the slave.
TMP19A43(rev2.0) 15-7
Serial Bus Interface (SBI)
TMP19A43
Control in the I2C Bus Mode
15.4.1 Setting the Acknowledgement Mode
Setting SBICR1 to "1" selects the acknowledge mode. When operating as a master, the SBI adds one clock for acknowledgment signals. As a transmitter, the SBI releases the SDA pin during this clock cycle to receive acknowledgment signals from the receiver. As a receiver, the SBI pulls the SDA pin to the "L" level during this clock cycle and generates acknowledgment signals. Setting to "0" selects the non-acknowledgment mode. When operating as a master, the SBI does not generate clock for acknowledgement signals.
15.4.2 Setting the Number of Bits per Transfer
SBICR1 specifies the number of bits of the next data to be transmitted or received. Under the start condition, is set to "000," causing a slave address and the direction bit to be transferred in a packet of eight bits. At other times, keeps a previously programmed value.
15.4.3 Serial Clock
Clock source SBICR1 specifies the maximum frequency of the serial clock to be output from the SCL pin in the master mode.
tHIGH tLOW 1/fscl
tLOW = 2
n-1
/(fsys/2) + 58/(fsys/2) /(fsys/2) + 12/(fsys/2)
tHIGH = 2
n-1
fscl = 1/(tLow + tHIGH) = fsys/2 2 + 70
n
SBI0CR1 000 001 010 011 100 101 110
n 5 6 7 8 9 10 11
Fig. 15.8 Clock Source The highest speeds in the standard and high-speed modes are specified to 100KHz and 400KHz respectively in the communications standards. Note that the internal SCL clock frequency is determined by the fsys used and the calculation formula shown above.
TMP19A43(rev2.0) 15-8
Serial Bus Interface (SBI)
TMP19A43
Clock Synchronization The I2C bus is driven by using the wired-AND connection due to its pin structure. The first master that pulls its clock line to the "L" level overrides other masters producing the "H" level on their clock lines. This must be detected and responded by the masters producing the "H" level. Clock synchronization assures correct data transfer on a bus that has two or more masters. For example, the clock synchronization procedure for a bus with two masters is shown below.
Wait for high-level period counting Start high-level period counting Internal SCL output (Master A) Reset high-level period counting
Internal SCL output (Master B)
SCL line a b c
Fig. 15.9 Example of Clock Synchronization At point a, Master A pulls its internal SCL output to the "L" level, bringing the SCL bus line to the "L" level. Master B detects this transition, resets its "H" level period counter, and pulls its internal SCL output level to the "L" level. Master A completes counting of its "L" level period at point b, and brings its internal SCL output to the "H" level. However, Master B still keeps the SCL bus line at the "L" level, and Master A stops counting of its "H" level period counting. After Master A detects that Master B brings its internal SCL output to the "H" level and brings the SCL bus line to the "H" level at point c, it starts counting of its "H" level period. This way, the clock on the bus is determined by the master with the shortest "H" level period and the master with the longest "L" level period among those connected to the bus.
15.4.4 Slave Addressing and Address Recognition Mode
When the SBI is configured to operate as a slave device, the slave address and must be set at I2CAR. Setting to "0" selects the address recognition mode.
15.4.5 Configuring the SBI as a Master or a Slave
Setting SBICR2 to "1" configures the SBI to operate as a master device. Setting to "0" configures the SBI as a slave device. is cleared to "0" by the hardware when the stop condition has been detected on the bus or when arbitration has been lost.
TMP19A43(rev2.0) 15-9
Serial Bus Interface (SBI)
TMP19A43
15.4.6 Configuring the SBI as a Transmitter or a Receiver
Setting SBICR2 to "1" configures the SBI as a transmitter. Setting to "0" configures the SBI as a receiver. In the slave mode, the SBI receives the direction bit ( R/ W ) from the master device on the following occasions: * * *
when data is transmitted in the addressing format when the received slave address matches the value specified at I2CCR when a general-call address is received; i.e., the eight bits following the start condition are all zeros
If the value of the direction bit ( R/ W ) is "1," is set to "1" by the hardware. If the bit is "0," is set to "0." As a master device, the SBI receives acknowledgement from a slave device. If the direction bit of "1" is transmitted, is set to "0" by the hardware. If the direction bit is "0," changes to "1." If the SBI does not receive acknowledgement, retains the previous value. is cleared to "0" by the hardware when the stop condition has been detected on the bus or when arbitration has been lost.
15.4.7 Generating Start and Stop Conditions
When SBISR is "0," writing "1" to SBICR2 causes the SBI to generate the start condition on the bus and output 8-bit data. must be set to "1" in advance.
SCL line
1 A6
2 A5
3 A4
4 A3
5 A2
6 A1
7 A0
8 R/W
9
SDA line Start condition
Slave address and direction bit
Acknowledgment signal
Fig. 15.10 Generating the Start Condition and a Slave Address
When is "1," writing "1" to and "0" to causes the SBI to start a sequence for generating the stop condition on the bus. The contents of should not be altered until the stop condition appears on the bus.
SCL line SDA line Stop condition
Fig. 15.11 Generating the Stop Condition
SBISR can be read to check the bus state. is set to "1" when the start condition is detected on the bus (the bus is busy), and set to "0" when the stop condition is detected (the bus is free).
TMP19A43(rev2.0) 15-10
Serial Bus Interface (SBI)
TMP19A43
15.4.8 Interrupt Service Request and Release
When a serial bus interface interrupt request (INTS0) is generated, SBICR2 is cleared to "0." While is "0," the SBI pulls the SCL line to the "L" level. After transmission or reception of one data word, is cleared to "0." It is set to "1" when data is written to or read from SBIDBR. It takes a period of tLOW for the SCL line to be released after is set to "1." In the address recognition mode ( = "0"), is cleared to "0" when the received slave address matches the value specified at I2CAR or when a general-call address is received; i.e., the eight bits following the start condition are all zeros. When the program writes "1" to SBICR2, it is set to "1." However, writing "0" does clear this bit to "0."
15.4.9 Serial Bus Interface Operating Modes
SBICR2 selects an operating mode of the serial bus interface. must be set to "10" to configure the SBI for the I2C bus mode. Make sure that the bus is free before switching the operating mode to the port mode.
15.4.10 Lost-arbitration Detection Monitor
The I2C bus has the multi-master capability (there are two or more masters on a bus), and requires the bus arbitration procedure to ensure correct data transfer. A master that attempts to generate the start condition while the bus is busy loses bus arbitration, with no start condition occurring on the SDA and SCL lines. The I2C-bus arbitration takes place on the SDA line. The arbitration procedure for two masters on a bus is shown below. Up until point a, Master A and Master B output the same data. At point a, Master A outputs the "L" level and Master B outputs the "H" level. Then Master A pulls the SDA bus line to the "L" level because the line has the wired-AND connection. When the SCL line goes high at point b, the slave device reads the SDA line data, i.e., data transmitted by Master A. At this time, data transmitted by Master B becomes invalid. In other words, Master B loses arbitration. Master B releases its SDA pin, so that it does not affect the data transfer initiated by another master. If two or more masters have transmitted exactly the same first data word, the arbitration procedure continues with the second data word.
SCL line Internal SDA output (Master A) Internal SDA output (Master B) SDA line a b Loses arbitration and sets the internal SDA output to "1."
Fig. 15.12 Lost Arbitration
TMP19A43(rev2.0) 15-11
Serial Bus Interface (SBI)
TMP19A43
A master compares the SDA bus line level and the internal SDA output level at the rising of the SCL line. If there is a difference between these two values, the master loses arbitration and sets SBI0SR to "1." When is set to "1," SBISR are cleared to "0," causing the SBI to operate as a slave receiver. is cleared to "0" when data is written to or read from SBIDBR or data is written to SBICR2.
Internal SCLoutput Master A Internal SDA output 1 2 D6A 3 D5A 4 D4A 5 D3A 6 D2A 7 D1A 8 D0A 9 1 2 3 4
D7A
D7A' D6A' D5A' D4A'
Clock output stops here Internal SCL output Master B Internal SDA output Access to SBIDBR or SBICR2 1 2 D6B 3 4
D7B
Internal SDA output is held high because Master B has lost arbitraiton.
Fig. 15.13 Example of Master B Losing Arbitration (D7A = D7B, D6A = D6B)
15.4.11 Slave Address Match Detection Monitor
When the SBI operates as a slave device in the address recognition mode (I2CCR = "0"), SBISR is set to "1" on receiving the general-call address or the slave address that matches the value specified at I2CCR. When is "1," is set to "1" when the first data word has been received. is cleared to "0" when data is written to or read from SBIDBR.
15.4.12 General-call Detection Monitor
When the SBI operates as a slave device, SBISR is set to "1" when it receives the general-call address; i.e., the eight bits following the start condition are all zeros. is cleared to "0" when the start or stop condition is detected on the bus.
15.4.13 Last Received Bit Monitor
SBISR is set to the SDA line value that was read at the rising of the SCL line. In the acknowledgment mode, reading SBISR immediately after generation of the INTS0 interrupt request causes ACK signal to be read.
TMP19A43(rev2.0) 15-12
Serial Bus Interface (SBI)
TMP19A43
15.4.14 Software Reset
If the serial bus interface circuit locks up due to external noise, it can be initialized by using a software reset. Writing "10" followed by "01" to SBICR2 generates a reset signal that initializes the serial bus interface circuit. After a reset, all control registers and status flags are initialized to their reset values. When the serial bus interface is initialized, is automatically cleared to "0."
(Note)
A software reset causes the SBI operating mode to switch from the I2C mode to the port mode.
15.4.15 Serial Bus Interface Data Buffer Register (SBIDBR)
Reading or writing SBIDBR initiates reading received data or writing transmitted data. When the SBI is acting as a master, setting a slave address and a direction bit to this register generates the start condition.
15.4.16 I2C Bus Address Register (I2CAR)
When the SBI is configured as a slave device, the I2CAR bit is used to specify a slave address. If I2C0AR is set to "0," the SBI recognizes a slave address transmitted by the master device and receives data in the addressing format. If is set to "1," the SBI does not recognize a slave address and receives data in the free data format.
15.4.17 IDLE Setting Register (SBIBR0)
The SBIBR0 register determines if the SBI operates or not when it enters the IDLE mode. This register must be programmed before executing an instruction to switch to the standby mode.
TMP19A43(rev2.0) 15-13
Serial Bus Interface (SBI)
TMP19A43
15.5 Data Transfer Procedure in the I2C Bus Mode
15.5.1 Device Initialization
First, program SBICR1 by writing "0" to bits 7 to 5 and bit 3 in SBICR1. Next, program I2CAR by specifying a slave address at and an address recognition mode at . ( must be set to"0" when using the addressing format.) Next, program SBICR2 to initially configure the SBI in the slave receiver mode by writing "0" to , "1" to , "10" to and "0" to bits 1 and 0.
765 SBICR1 0 0 0 I2CAR XXX SBICR2 0 0 0 (Note) X: Don't care 4 X X 1 3 0 X 1 2 X X 0 1 X X 0 0 X X 0
Specifies ACK and SCL clock. Specifies a slave address and an address recognition mode. Configures the SBI as a slave receiver.
15.5.2 Generating the Start Condition and a Slave Address
Master mode In the master mode, the following steps are required to generate the start condition and a slave address. First, ensure that the bus is free ( = "0"). Then, write "1" to SBICR1 to select the acknowledgment mode. Write to SBIDBR a slave address and a direction bit to be transmitted. When = "0," writing "1111" to SBICR2 generates the start condition on the bus. Following the start condition, the SBI generates nine clocks from the SCL pin. The SBI outputs the slave address and the direction bit specified at SBIDBR with the first eight clocks, and releases the SDA line in the ninth clock to receive an acknowledgment signal from the slave device. The INTS0 interrupt request is generated on the falling of the ninth clock, and is cleared to "0." In the master mode, the SBI holds the SCL line at the "L" level while is "0." changes its value according to the transmitted direction bit at generation of the INTS0 interrupt request, provided that an acknowledgment signal has been returned from the slave device. Settings in main routine
Reg. Reg. if Reg. Then SBICR1 SBIDR1 SBICR2 76543210 SBISR Reg. e 0x20 0x00 XXX10XXX XXXXXXXX 11111000
Ensures that the bus is free. Selects the acknowledgement mode. Specifies the desired slave address and direction. Generates the start condition.
Example of INTS0 interrupt routine
INTCLR 0x78 Processing End of interrupt
Clears the interrupt request.
TMP19A43(rev2.0) 15-14
Serial Bus Interface (SBI)
TMP19A43
Slave mode In the slave mode, the SBI receives the start condition and a slave address. After receiving the start condition from the master device, the SBI receives a slave address and a direction bit from the master device during the first eight clocks on the SCL line. If the received address matches its slave address specified at I2CAR or is equal to the general-call address, the SBI pulls the SDA line to the "L" level during the ninth clock and outputs an acknowledgment signal. The INTS0 interrupt request is generated on the falling of the ninth clock, and is cleared to "0." In the slave mode, the SBI holds the SCL line at the "L" level while is "0."
(Note)
The user can only use a DMA transfer: * when there is only one master and only one slave and * continuous transmission or reception is possible.
SCL SDA
1 A6
2 A5
3 A4
4 A3
5 A2
6 A1
7 A0
8
R/ W
9 ACK Acknowledgement from slave
Start condition Slave address + Direction bit INTS0 interrupt request
Master to slave Slave to master
Fig. 15.14 Generation of the Start Condition and a Slave Address
15.5.3 Transferring a Data Word
At the end of a data word transfer, the INTS0 interrupt is generated to test to determine whether the SBI is in the master or slave mode. Master mode ( = "1") Test to determine whether the SBI is configured as a transmitter or a receiver. Transmitter mode ( = "1") Test . If is "1," that means the receiver requires no further data. The master then generates the stop condition as described later to stop transmission. If is "0," that means the receiver requires further data. If the next data to be transmitted has eight bits, the data is written into SBIDBR. If the data has different length, and are programmed and the transmit data is written into SBIDBR. Writing the data makes to"1," causing the SCL pin to generate a serial clock for transfer of a next data word, and the SDA pin to transfer the data word. After the transfer is completed, the INTS0 interrupt request is generated, is set to "0," and the SCL pin is pulled to the "L" level. To transmit more data words, test again and repeat the above procedure.
TMP19A43(rev2.0) 15-15
Serial Bus Interface (SBI)
TMP19A43
INTS0 interrupt if MST = 0 Then go to the slave-mode processing if TRX = 0 Then go to the receiver-mode processing if LRB = 0 Then go to processing for generating the stop condition
SBICR1 XXXX0XXX SBIDBR X X X X X X X X End of interrupt processing (Note) X: Don't care Specifies the number of bits to be transmitted and specify whether ACK is required. Writes the transmit data.
SCL pin Write to SBI0DBR SDA pin
1 D7
2 D6
3 D5
4 D4
5 D3
6 D2
7 D1
8 D0
9 ACK
Acknowledgment signal from receiver

INTS0 interrupt request
Master to slave Slave to master
Fig. 15.15 = "000" and = "1" (Transmitter Mode)
Receiver mode ( = "0") If the next data to be transmitted has eight bits, the transmit data is written into SBIDBR. If the data has different length, and are programmed and the received data is read from SBIDBR to release the SCL line. (The data read immediately after transmission of a slave address is undefined.) On reading the data, is set to "1," and the serial clock is output to the SCL pin to transfer the next data word. In the last bit, when the acknowledgment signal becomes the "L" level, "0" is output to the SDA pin. After that, the INTS0 interrupt request is generated, and is cleared to "0," pulling the SCL pin to the "L" level. Each time the received data is read from SBIDBR, one-word transfer clock and an acknowledgement signal are output.
Read the received data SCL 1 D7 2 D6 3 D5 4 D4 5 D3 6 D2 7 D1 8 D0 9 ACK Next D7
Acknowledgment signal to transmitter
SDA

INTS interrupt request Master to slave Slave to master
Fig. 15.16 = "000" and = "1" (Receiver Mode)
TMP19A43(rev2.0) 15-16
Serial Bus Interface (SBI)
TMP19A43
To terminate the data transmission from the transmitter, must be set to "0" immediately before reading the second to last data word. This disables generation of an acknowledgment clock for the last data word. When the transfer is completed, an interrupt request is generated. After the interrupt processing, must be set to "001" and the data must be read so that a clock is generated for 1-bit transfer. At this time, the master receiver holds the SDA bus line at the "H" level, which signals the end of transfer to the transmitter as an acknowledgment signal. In the interrupt processing for terminating the reception of 1-bit data, the stop condition is generated to terminate the data transfer.
SCL 9 1 D7 2 D6 3 D5 4 D4 5 D3 6 D2 7 D1 8 D0 1
SDA
Acknowledgment signal to transmitter

INTS0 interrupt request
Read out the received data after clearing to "0."
Read out the received data after setting to "001."
Master to slave Slave to master
Fig. 15.17 Terminating Data Transmission in the Master Receiver Mode
Example: When receiving N data words INTS0 interrupt (after data transmission)
SBICR1 76543210 XXXX0XXX
Reg. SBI0CBR End of interrupt
Sets the number of bits of data to be received and specify whether ACK is required. Reads dummy data.
INTS0 interrupt (first to (N-2)th data reception)
76543210 Reg. SBIDBR End of interrupt
Reads the first to (N-2)th data words.
INTS0 interrupt ( (N-1)th data reception)
76543210 SBI0CR1 X X X 0 0 X X X Reg. SBIDBR End of interrupt
Disables generation of acknowledgement clock. Reads the (N-1)th data word.
INTS0 interrupt (Nth data reception)
76543210 SBI0CR1 0 0 1 0 0 X X X Reg. SBIDBR End of interrupt
Generates a clock for 1-bit transfer. Reads the Nth data word.
INTS0 interrupt (after completing data reception)
Processing to generate the stop condition End of interrupt (Note) X: Don't care
Terminates the data transmission.
TMP19A43(rev2.0) 15-17
Serial Bus Interface (SBI)
TMP19A43
Slave mode ( = "0") In the slave mode, the SBI generates the INTS0 interrupt request on four occasions: 1) when the SBI has received any slave address from the master, 2) when the SBI has received a general-call address, 3) when the received slave address matches its own address, and 4) when a data transfer has been completed in response to a general-call. Also, if the SBI loses arbitration in the master mode, it switches to the slave mode. Upon the completion of data word transfer in which arbitration is lost, the INTS0 interrupt request is generated, is cleared to "0," and the SCL pin is pulled to the "L" level. When data is written to or read from SBIDBR or when is set to "1," the SCL pin is released after a period of tLOW. In the slave mode, the normal slave mode processing or the processing as a result of lost arbitration is carried out. SBISR , , and are tested to determine the processing required. Table 15.1 shows the slave mode states and required processing. Example: When the received slave address matches the SBI's own address and the direction bit is "1" in the slave receiver mode INTS0 interrupt
if TRX = 0 Then go to other processing if AL = 1 Then go to other processing if AAS = 0 Then go to other processing SBICR1 X X X 1 0 X X X SBIDBR X X X X 0 X X X (Note) X: Don't care
Sets the number of bits to be transmitted. Sets the transmit data.
TMP19A43(rev2.0) 15-18
Serial Bus Interface (SBI)
TMP19A43
Table 15.1 Processing in Slave Mode
1 1 1 0 State Arbitration was lost while the slave address was being transmitted, and the SBI received a slave address with the direction bit "1" transmitted by another master. In the slave receiver mode, the SBI received a slave address with the direction bit "1" transmitted by the master. In the slave transmitter mode, the SBI has completed a transmission of one data word. Processing Set the number of bits in a data word to and write the transmit data into SBI0DBR.
0
1
0
0
0
0
1
1
1/0
0
0
0
1
1/0
0
1/0
Arbitration was lost while a slave address was being transmitted, and the SBI received either a slave address with the direction bit "0" or a general-call address transmitted by another master. Arbitration was lost while a slave address or a data word was being transmitted, and the transfer terminated. In the slave receiver mode, the SBI received either a slave address with the direction bit "0" or a general-call address transmitted by the master. In the slave receiver mode, the SBI has completed a reception of a data word.
Test LRB. If it has been set to "1," that means the receiver does not require further data. Set to 1 and reset to 0 to release the bus. If has been reset to "0," that means the receiver requires further data. Set the number of bits in the data word to and write the transmit data to the SBIDBR. Read the SBIDBR (a dummy read) to set to 1, or write "1" to .
Set the number of bits in the data word to and read the received data from SBIDBR.
TMP19A43(rev2.0) 15-19
Serial Bus Interface (SBI)
TMP19A43
15.5.4 Generating the Stop Condition
When SBISR is "1," writing "1" to SBICR2 and "0" to causes the SBI to start a sequence for generating the stop condition on the bus. Do not alter the contents of until the stop condition appears on the bus. If another device is holding down the SCL bus line, the SBI waits until the SCL line is released. After that, the SDA pin goes high, causing the stop condition to be generated.
76543210 11011000
SBICR2
Generates the stop condition.
"1" "1" "0" "1" SCL pin SDA pin
Stop condition
(read)
Fig. 15.18 Generating the Stop Condition
TMP19A43(rev2.0) 15-20
Serial Bus Interface (SBI)
TMP19A43
15.5.5 Repeated Start Procedure
Repeated start is used when a master device changes the data transfer direction without terminating the transfer to a slave device. The procedure of generating a repeated start in the master mode is described below. First, set SBICR2 to "0" and write "1" to to release the bus. At this time, the SDA pin is held at the "H" level and the SCL pin is released. Because no stop condition is generated on the bus, other devices think that the bus is busy. Then, test SBISR and wait until it becomes "0" to ensure that the SCL pin is released. Next, test and wait until it becomes "1" to ensure that no other device is pulling the SCL bus line to the "L" level. Once the bus is determined to be free this way, use the steps described above in (2) to generate the start condition. To satisfy the setup time of repeated start, at least 4.7-s wait period (in the standard mode) must be created by the software after the bus is determined to be free.
76543210 SBICR2 0 0 0 1 1 0 0 0 if SBISR 0 Then if SBISR 1 Then 4.7 s Wait SBICR1 X X X 1 0 X X X SBIDBR X X X X X X X X SBICR2 1 1 1 1 1 0 0 0 (Note) X: Don't care
"0" "0" "0" "1" "1" "1" "1" "1"
Releases the bus. Checks that the SCL pin is released. Checks that no other device is pulling the SCL pin to the "L" level.
Selects the acknowledgment mode. Sets the desired slave address and direction. Generates the start condition.
4.7 s (min.) SCL (bus) SCL pin SDA pin 9
Start condition
(Note)
Do not write to "0" when it is "0." (Repeated start cannot be done.) Fig. 15.19 Timing Chart of Generating a Repeated Start
TMP19A43(rev2.0) 15-21
Serial Bus Interface (SBI)
TMP19A43
15.6 Control in the Clock-synchronous 8-bit SIO Mode
The following registers control the serial bus interface in the clock-synchronous 8-bit SIO mode and provide its status information for monitoring.
Serial bus interface control register 0
7 Bit symbol SBICR0 Read/Write (0xFFFF_F257) After reset Function SBIEN R/W 0 SBI operation 0: Disable 1: Enable R 0 This can be read as "0." 6 5 4 3 2 1 0
:
To use the SBI, enable the SBI operation ("1") before setting each register of SBI module.
Serial bus interface control register 1
7 SBICR1 (0xFFFF_F250) Read/Write After reset Function Bit symbol SIOS 0 6 SIOINH W 0 0 0
Start transfer Abort transfer 0: Stop 0: Continue 1: Start 1: Abort Select transfer mode 00: Transmit mode 01: (Reserved) 10: Transmit/receive mode 11: Receive mode
5 SIOM1
4 SIOM0
3
2 SCK2
1 SCK1
0 SCK0 R/W 1
R W 1 0 0 Select serial clock frequency This can be read as "1."
On writing : Select serial clock frequency 000 n = 3 1.25 MHz 001 n = 4 625 kHz System clock : fsys 010 n = 5 313 kHz (=40 MHz) 011 n = 6 156 kHz Clock gear : fc/1 78 kHz 100 n = 7 fsys/4 Frequency = [Hz] n 39 kHz 101 n = 8 2 20 kHz 110 n = 9 111 External clock
(Note)
Set to "0" and to "1" before programming the transfer mode and the serial clock. Serial bus interface data buffer register
SBIDBR (0xFFFF_F251) Bit symbol Read/Write After reset
7 DB7
6 DB6
5 DB5
4 DB4
3 DB3
2 DB2
1 DB1
0 DB0
R (Receive)/W (Transmit) Undefined
Fig. 15.20 SIO Mode Registers
TMP19A43(rev2.0) 15-22
Serial Bus Interface (SBI)
TMP19A43
Serial bus interface control register 2
7 Bit symbol SBICR2 Read/Write (0xFFFF_F253) After reset Function 6 R 1 This can be read as "1." 5 4 3 SBIM1 W 0 0
Select serial bus interface operating mode 00: Port mode 01: Clock-synchronous 8-bit SIO mode 10: I2C bus mode 11: (Reserved)
2 SBIM0
1 R 1
0
This can be read as "1."
Serial bus interface register
7 SBISR Read/Write (0xFFFF_F253) After reset Function Bit symbol 6 5 4 3 SIOF R 1 This can be read as "1." R 0
Serial transfer status monitor
0: Terminated 1: In progress
2 SEF 0
Shift operation status monitor
0: Terminated 1: In progress
1
0
R 1 This can be read as "1."
Serial bus interface baud rate register 0
7 SBIBR0 Read/Write (0xFFFF_F254) After reset Function Bit symbol 6 I2SBI R R/W 1 0 This can IDLE This can be read as "1." be read as 0: Stop "1." 1: Operate R 1 W 0 Make sure that you write "0." 5 4 3 2 1 0
Fig. 15.11 SIO Mode Registers
TMP19A43(rev2.0) 15-23
Serial Bus Interface (SBI)
TMP19A43
15.6.1 Serial Clock
Clock source Internal or external clocks can be selected by programming SBICR1 . Internal clocks In the internal clock mode, one of the seven frequencies can be selected as a serial clock, which is output to the outside through the SCK pin. At the beginning of a transfer, the SCK pin output becomes the "H" level. If the program cannot keep up with this serial clock rate in writing the transmit data or reading the received data, the SBI automatically enters a wait period. During this period, the serial clock is stopped automatically and the next shift operation is suspended until the processing is completed.
Automatic wait SCK pin output 1 2 3 7 8 1 2 6 7 8 1 2 3
SO pin output Write the transmit data
a0 a
a1
a2 a 5
a6
a7
b0 b
b1 c
b4
b5
b6
b7
c0
c1
c2
Fig. 15.22 Automatic Wait
External clock ( = "111") The SBI uses an external clock supplied from the outside to the SCK pin as a serial clock. For proper shift operations, the serial clock at the "H" and "L" levels must have the pulse widths as shown below.
SCK pin tSCKL tSCKH tSCKL, tSCKH > 8/fsys
Fig. 15.23 Maximum Transfer Frequency of External Clock Input
TMP19A43(rev2.0) 15-24
Serial Bus Interface (SBI)
TMP19A43
Shift Edge Leading-edge shift is used in transmission. Trailing-edge shift is used in reception. Leading-edge shift Data is shifted at the leading edge of the serial clock (or the falling edge of the SCK pin input/output). Trailing-edge shift Data is shifted at the trailing edge of the serial clock (or the rising edge of the SCK pin input/output).
SCK pin SO pin
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
Shift register
76543210 *7654321 **765432
***76543
****7654
*****765
******76
******7
(a) Leading-edge shift
SCK pin bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7
SI pin
Shift register
********
0*******
10******
210*****
3210****
43210***
543210** 6543210* 76543210
(b) Trailing-edge shift
(Note) *: Don't care
Fig. 15.24 Shift Edge
TMP19A43(rev2.0) 15-25
Serial Bus Interface (SBI)
TMP19A43
15.6.2 Transfer Modes
The transmit mode, the receive mode or the transmit/receive mode can be selected by programming SBICR1 . 8-bit transmit mode Set the control register to the transmit mode and write the transmit data to SBIDBR. After writing the transmit data, writing "1" to SBICR1 starts the transmission. The transmit data is moved from SBIDBR to a shift register and output to the SO pin, with the leastsignificant bit (LSB) first, in synchronization with the serial clock. Once the transmit data is transferred to the shift register, SBIDBR becomes empty, and the INTS0 (buffer-empty) interrupt is generated, requesting the next transmit data. In the internal clock mode, the serial clock will be stopped and automatically enter the wait state, if next data is not loaded after the 8-bit data has been fully transmitted. The wait state will be cleared when SBIDBR is loaded with the next transmit data. In the external clock mode, SBIDBR must be loaded with data before the next data shift operation is started. Therefore, the data transfer rate varies depending on the maximum latency between when the interrupt request is generated and when SBIDBR is loaded with data in the interrupt service program. At the beginning of transmission, the same value as in the last bit of the previously transmitted data is output in a period from setting SBISR to "1" to the falling edge of SCK. Transmission can be terminated by clearing to "0" or setting to "1" in the INTS0 interrupt service program. If is cleared, remaining data is output before transmission ends. The program checks SBI0SR to determine whether transmission has come to an end. is cleared to "0" at the end of transmission. If is set to "1," the transmission is aborted immediately and is cleared to "0." In the external clock mode, must be set to "0" before the next transmit data shift operation is started. Otherwise, operation will stop after dummy data is transmitted.
76543210 01000XXX XXXXXXXX 10000XXX
SBICR1 SBIDBR SBICR1
Selects the transmit mode. Writes the transmit data. Starts transmission.
INTS0 interrupt
SBIDBR XXXXXXXX
Writes the transmit data.
TMP19A43(rev2.0) 15-26
Serial Bus Interface (SBI)
TMP19A43
is cleared SCK pin (output) SO pin INTS0 interrupt request SBIDBR a b (a) Internal clock Write the transmit data is cleared SCK pin (input) SO pin INTS0 interrupt request a b (b) External clock Write the transmit data * a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7 * a0 a1 a2 a3 a4 a5 a6 a7 b0 b1 b2 b3 b4 b5 b6 b7
SBIDBR
Fig. 15.25 Transmit Mode
Example: Example of programming (MIPS16) to terminate transmission by (external clock)
ADDIU STEST1 : LB AND BNEZ ADDIU STEST2 : LB AND BEQZ ADDIU STB r3, r2, r2, r3, r2, r2, r3, r0, r3 STEST1 r0, r3 STEST2 r0, 0y00000111 ; 0 0x20 ; If SCK = 0 then loop 0x04 ; If SBISR = 1 then loop
r2, (SBISR)
r2, (PA)
r3, (SBICR1)
TMP19A43(rev2.0) 15-27
Serial Bus Interface (SBI)
TMP19A43
SCK pin SIOF SO pin bit 6 bit 7 tSODH = Min. 3.5/fsys/2 [s]
Fig. 15.26 Transmit Data Retention Time at the End of Transmission
8-bit receive mode Set the control register to the receive mode. Then writing "1" to SBICR1 enables reception. Data is taken into the shift register from the SI pin, with the least-significant bit (LSB) first, in synchronization with the serial clock. Once the shift register is loaded with the 8-bit data, it transfers the received data to SBIDBR and the INTS0 (buffer-full) interrupt request is generated to request reading the received data. The interrupt service program then reads the received data from SBIDBR. In the internal clock mode, the serial clock will be stopped and automatically be in the wait state until the received data is read from SBIDBR. In the external clock mode, shift operations are executed in synchronization with the external clock. The maximum data transfer rate varies, depending on the maximum latency between generating the interrupt request and reading the received data. Reception can be terminated by clearing to "0" or setting to "1" in the INTS0 interrupt service program. If is cleared, reception continues until all the bits of received data are written to SBIDBR. The program checks SBISR to determine whether reception has come to an end. is cleared to "0" at the end of reception. After confirming the completion of the reception, last received data is read. If is set to "1," the reception is aborted immediately and is cleared to "0." (The received data becomes invalid, and there is no need to read it out.)
(Note)
The contents of SBIDBR will not be retained after the transfer mode is changed. The ongoing reception must be completed by clearing to "0" and the last received data must be read before the transfer mode is changed.
SBICR1 SBICR1
76543210 01110XXX 10110000
Selects the receive mode. Starts reception.
INTS0 interrupt
Reg. SBIDBR
Reads the received data.
TMP19A43(rev2.0) 15-28
Serial Bus Interface (SBI)
TMP19A43
is cleared SCK pin (output) SI pin
INTS0 interrupt request
a0
a1
a2
a3
a4
a5
a6
a7
b0
b1
b2
b3
b4
b5
b6
b7
SBIDBR
a Read the received data
b Read the received data
Fig. 15.27 Receive Mode (Example: Internal Clock)
8-bit transmit/receive mode Set the control register to the transfer/receive mode. Then writing the transmit data to SBIDBR and setting SBICR1 to "1" enables transmission and reception. The transmit data is output through the SO pin at the falling of the serial clock, and the received data is taken in through the SI pin at the rising of the serial clock, with the least-significant bit (LSB) first. Once the shift register is loaded with the 8-bit data, it transfers the received data to SBIDBR and the INTS0 interrupt request is generated. The interrupt service program reads the received data from the data buffer register and writes the next transmit data. Because SBIDBR is shared between transmit and receive operations, the received data must be read before the next transmit data is written. In the internal clock operation, the serial clock will be automatically in the wait state until the received data is read and the next transmit data is written. In the external clock mode, shift operations are executed in synchronization with the external serial clock. Therefore, the received data must be read and the next transmit data must be written before the next shift operation is started. The maximum data transfer rate for the external clock operation varies depending on the maximum latency between generating the interrupt request and reading the received data and writing the transmit data. At the beginning of transmission, the same value as in the last bit of the previously transmitted data is output in a period from setting to "1" to the falling edge of SCK. Transmission and reception can be terminated by clearing to "0" or setting SBICR1 to "1" in the INTS0 interrupt service program. If is cleared, transmission and reception continue until the received data is fully transferred to SBIDBR. The program checks SBISR to determine whether transmission and reception have come to an end. is cleared to "0" at the end of transmission and reception. If is set, the transmission and reception are aborted immediately and is cleared to "0."
(Note)
The contents of SBIDBR will not be retained after the transfer mode is changed. The ongoing transmission and reception must be completed by clearing to "0" and the last received data must be read before the transfer mode is changed.
TMP19A43(rev2.0) 15-29
Serial Bus Interface (SBI)
TMP19A43
is cleared SCK pin (output) SO pin SI pin INTS0 interrupt request SBIDBR a c b d Read the received data (d) * a0 c0 a1 c1 a2 c2 a3 c3 a4 c4 a5 c5 a6 c6 a7 c7 b0 d0 b1 d1 b2 d2 b3 d3 b4 d4 b5 d5 b6 d6 b7 d7
Write the transmit data (a) Read the received data (c) Write the transmit data (b)
Fig. 15.28 Transmit/Receive Mode (Example: Internal Clock)
SCK pin SIOF SO pin bit 6 bit 7 of the last word transmitted tSODH = Min. 4/fsys/2 [s]
Fig. 15.6.2 Transmit Data Retention Time at the End of Transmission/Reception (In the Transmit/Receive Mode)
SBICR1 SBIDBR SBICR1
76543210 01100XXX XXXXXXXX 10100XXX
Selects the transmit mode. Writes the transmit data. Starts reception/transmission.
INTS0 interrupt
Reg. SBIDBR SBIODBR XXXXXXXX
Reads the received data. Writes the transmit data.
TMP19A43(rev2.0) 15-30
Serial Bus Interface (SBI)
TMP19A43
16. Analog/Digital Converter
A 10-bit, sequential-conversion analog/digital converter (A/D converter) is built into the TMP19A43. This A/D converter is equipped with 16 analog input channels. Fig. 16-1 shows the block diagram of this A/D converter. These 16 analog input channels (pins AN0 through AN15) are also used as input ports. (Note) If it is necessary to reduce a power current by operating the TMP19A43 in IDLE, SLEEP, SLOW or STOP mode and if either case shown below is applicable, you must first stop the A/D converter and then execute the instruction to put the TMP19A43 into standby mode: 1) 2) The TMP19A43 must be put into IDLE mode when ADMOD1 is "0." The TMP19A43 must be put into SLEEP, SLOW or STOP mode.
Internal data bus Internal data bus
Internal data bus
ADS ADMOD1 ADMOD0
ADMOD2
ADMOD3
ADMOD4
ADSCN end
HPADCE busy scan End AD monitor function control start Busy TB0/CTRG High-priority AD conversion control
Top-priority AD conversion completion interrupt AD monitor function interrupt
Channel select control circuit
repeat interrupt Interval Normal A/D conversion control circuit
AD start control
AN15 (P87) Multiplexer
Interrupt request INTAD
ADTRG (PD6)
AN7 (P77)
AN0 (P70) Comparator AD conversion result register ADREGSP
VREFH VREFL
VREF D/A converter
Fig. 16-1 A/D Converter Block Diagram
TMP19A43(rev2.0) 16-1
Comparator
-
Analog/Digital Converter
Comparison register
Sample hold
+
A/D conversion result register ADREG08L-7FL ADREG08H-7FH
TMP19A43
Note) Please set the following before the analog to digital conversion begins to guarantee the conversion accuracy.
0xFFFF_F319 0x58
7
ADCBAS (0xFFFF_F319)
6 R/W 0
Write "1"
5
R/W
4
R/W
3 R/W 1
Write "1"
2 R 0
Write "0"
1
R/W
0
R/W
bit Symbol Read/Write After reset Function R/W 0
Write "0"
1
Write "0"
1
Write "1"
0
Write "0"
0
Write "0"
16.1
Control Register
The A/D converter is controlled by A/D mode control registers (ADMOD0, ADMOD1, ADMOD2, ADMOD3 and ADMOD4). Results of A/D conversion are stored in 16 upper and lower A/D conversion result registers ADREG08H/L through ADREG7FH/L. Results of top-priority conversion are stored in ADREGSPH/L. Fig. 16-2 shows the registers related to the A/D converter.
A/D Mode Control Register 0 7 6
ADBFN R 0
Normal A/D conversion completion flag
5
R
4
ITM1
3
ITM0 0
Specify interrupt in fixed channel repeat conversion mode
2
REPEAT R/W 0
Specify repeat mode 0: Single conversion mode 1: Repeat conversion mode
1
SCAN 0
Specify scan mode 0: Fixed channel mode 1: Channel scan mode
0
ADS 0
Start A/D conversion 0: Don't care 1: Start conversion "0" is always read.
ADMOD0 bit Symbol (0xFFFF_F314) Read/Write After reset
EOCFN
0
Normal A/D conversion BUSY flag
0
"0" is read.
0
Specify interrupt in fixed channel repeat conversion mode
Function
0: Conversion 0: Before or stop during 1: During conversion conversion 1: Completion
Specify A/D conversion interrupt in fixed channel repeat conversion mode Fixed channel repeat conversion mode = "0," = "1" 00 Generate interrupt once every single conversion 01 Generate interrupt once every 4 conversions 10 Generate interrupt once every 8 conversions 11 Setting prohibited
Fig. 16-2 Registers related to the A/D Converter
TMP19A43(rev2.0) 16-2
Analog/Digital Converter
TMP19A43
A/D Mode Control Register 1 7
bit Symbol ADMOD1 (0xFFFF_ F315) Read/Write After reset Function VREFON 0
VREF application control 0: OFF 1: ON
6
I2AD 0
IDLE 0: Stop 1: Activate
5
ADSCN 0
Specify operation mode for channel scanning 0: 4ch scan 1: 8ch scan
4
- R/W 0
Write "0."
3
ADCH3 0
2
ADCH2 0
1
ADCH1 0
0
ADCH0 0
Select analog input channel

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Select analog input channel 0 Fixed channel
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN8 AN9 AN10 AN11 AN12 AN13 AN14 AN15 AN0
1 Channel scan (ADSCN=0)
AN0
1 Channel scan (ADSCN=1)
AN0 to AN1 AN0 to AN2 AN0 to AN3 AN0 to AN4 AN0 to AN5 AN0 to AN6 AN0 to AN7 AN8 AN8 to AN9 AN8 to AN10 AN8 to AN11 AN8 to AN12 AN8 to AN13 AN8 to AN14 AN8 to AN15
AN0 to AN1 AN0 to AN2 AN0 to AN3 AN4 AN4 to AN5 AN4 to AN6 AN4 to AN7 AN8 AN8 to AN9 AN8 to AN10 AN8 to AN11 AN12 AN12 to AN13 AN12 to AN14 AN12 to AN15
(Note 1) Before starting AD conversion, write "1" to the bit, wait for 3 s during which time the internal reference voltage should stabilize, and then write "1" to the ADMOD0 bit. (Note 2) To go into standby mode upon completion of AD conversion, set to "0."
Fig. 16-3 Registers related to the A/D Converter
TMP19A43(rev2.0) 16-3
Analog/Digital Converter
TMP19A43
A/D Mode Control Register 2 7
ADMOD2 (0xFFFF_ F316)
6
ADBFHP R 0
Top-priority AD conversion BUSY flag 0: During conversion halts 1: During conversion
5
HPADCE
4
-
3
2
1
0
bit Symbol Read/Write After reset
EOCFHP R 0
Top-priority AD conversion completion flag 0: Before or during conversion 1: Upon completion
HPADC HPADCH2 HPADCH1 HPADCH0 H3 R/W 0 0 0 0
0
Activate top-priority conversion 0: Don't care 1: Start conversion. "0" is always read.
0
Write "0."
Select analog input channel when activating top-priority conversion
Function

0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111
Analog input channel when executing top-priority conversion
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN8 AN9 AN10 AN11 AN12 AN13 AN14 AN15
TMP19A43(rev2.0) 16-4
Analog/Digital Converter
TMP19A43
A/D Mode Control Register 3 7
ADMOD3 (0xFFFF _F317) Read/Write
6
R 0
5
ADOBIC
4
REGS3
0
3
REGS2
R/W 0
2
REGS1
0
1
REG0
0
0
ADOBSV
0
AD monitor function 0: Disable 1: Enable
bit Symbol
R/W 0
Write "0."
After reset Function
0
function interrupt setting 0: Smaller than comparison Regi 1: Larger than comparison Regi
"0" is read. Make AD monitor
BIT for selecting the AD conversion result storage Regi that is to be compared with the comparison Regi if the AD monitor function is enabled

0000 0001 0010 0011 0100 0101 0110 0111 1XXX
AD conversion result storage Regi to be compared
ADREG08 ADREG19 ADREG2A ADREG3B ADREG4C ADREG5D ADREG6E ADREG7F ADREGSP
A/D Mode Control Register 4 7
ADMOD4 (0xFFFF_F318)
6
HADHTG
R/W
0
HW for activating top-priority A/D conversion 0: Disable 1: Enable
5
ADHS
0
HW source for activating normal A/D conversion 0: External TRG 1: TB1TRG
4
ADHTG
3
R
2
1
ADRST1
W
-
0
ADRST0
W
-
bit Symbol
Read/Write
After reset
Function
HADHS
0
HW source for activating top-priority A/D conversion 0: External TRG 1: TB9TRG
0
HW for activating normal A/D conversion 0: Disable 1: Enable "0" is read.
0
Overwriting 10 with 01 allows ADC to be software reset.
(Note 1) If AD conversion is executed with the match triggers and of a 16-bit timer set to "1" by using a source for triggering H/W, A/D conversion can be activated at specified intervals by performing three steps shown below when the timer is idle: Select a source for triggering HW: , Enable H/W activation of AD conversion: , Start the timer. (Note 2) Do not make a top-priority AD conversion setting and a normal AD conversion setting simultaneously.
TMP19A43(rev2.0) 16-5
Analog/Digital Converter
TMP19A43
Lower A/D Conversion Result Register 08 7
ADREG08L (0xFFFF_F300)
6
ADR00
R
0
5
4
R
1
3
2
1
OVR0
R
0
Over RUN flag 0: Not generate 1: Generate
0
ADR0RF
R
0
A/D conversion result storage flag 1: Presence of conversion result
bit Symbol
Read/Write
After reset
Function
ADR01
Store lower 2 bits of A/D conversion result
"1" is read.
Upper A/D Conversion Result Register 08 7
ADREG08H (0xFFFF_F301)
6
ADR08
5
ADR07
4
ADR06
R
0
3
ADR05
2
ADR04
1
ADR03
0
ADR02
bit Symbol
Read/Write
After reset
Function
ADR09
Store upper 8 bits of A/D conversion result
Lower A/D Conversion Result Register 19 7
ADREG19L (0xFFFF_F302)
6
ADR10
R
0
5
4
R
1
3
2
1
OVR1
R
0
Over RUNflag 0: Not generate 1: Generate
0
ADR1RF
R
0
A/D conversion result storage flag 1: Presence of conversion result
bit Symbol
Read/Write
After reset
Function
ADR11
Store lower 2 bits of A/D conversion result
"1" is read.
Upper A/D Conversion Result Register 19 7
ADREG19H (0xFFFF_F303)
6
ADR18
5
ADR17
4
ADR16
R
0
3
ADR15
2
ADR14
1
ADR13
0
ADR12
bit Symbol
Read/Write
After reset
Function
ADR19
Store upper 8 bits of A/D conversion result
9 8 7 6 5 4 3 2 1 0
Converted channel x value
ADREGxH
ADREGxL
7
6
5
4
3
2
1
0
7
6
5
4
3
2
1
0
* * * *
Values read from bits 5 through 2 are always "1." Bit 0 is the A/D conversion result storage flag . This bit is set to "1" after an A/D converted value is stored. A read of a lower register (ADREGxL) will set this bit to "0." Bit 1 is the over RUN flag . This bit is set to "1" if a conversion result is overwritten before both conversion result storage registers (ADREGxH and ADREGxL) are read. A read of a flag will clear this bit to "0." When reading conversion result storage registers, first read upper registers and then lower registers.
Fig. 16-4 Registers related to the A/D Converter
TMP19A43(rev2.0) 16-6
Analog/Digital Converter
TMP19A43
Lower A/D Conversion Result Register 2A 7
ADREG2AL (0xFFFF_F304) bit Symbol Read/Write After reset ADR21 R 0 Store lower 2 bits of A/D conversion result "1" is read.
6
ADR20
5
4
R 1
3
2
1
OVR2 R 0
Over RUN flag 0: Not generate 1: Generate
0
ADR2RF R 0
A/D conversion result storage flag 1: Presence of conversion result
Function
Upper A/D Conversion Result Register 2A 7
ADREG2AH (0xFFFF_F305) bit Symbol Read/Write After reset Function ADR29
6
ADR28
5
ADR27
4
ADR26 R 0
3
ADR25
2
ADR24
1
ADR23
0
ADR22
Store upper 8 bits of A/D conversion result
Lower A/D Conversion Result Register 3B 7
ADREG3BL (0xFFFF_F306) bit Symbol Read/Write After reset Function ADR31 R 0 Store lower 2 bits of A/D conversion result "1" is read.
6
ADR30
5
4
R 1
3
2
1
OVR3 R 0
Over RUN flag 0: Not generate 1: Generate
0
ADR3RF R 0
A/D conversion result storage flag 1: Presence of conversion result
Upper A/D Conversion Result Register 3B 7
bit Symbol ADREG3BH (0xFFFF_F307) Read/Write After reset Function 9 Converted channel x value ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2 ADREGxL 1 0 8 7 ADR39
6
ADR38
5
ADR37
4
ADR36 R 0
3
ADR35
2
ADR34
1
ADR33
0
ADR32
Store upper 8 bits of A/D conversion result 6 5 4 3 2 1 0
* * * *
Values read from bits 5 through 2 are always "1." Bit 0 is the A/D conversion result storage flag . It is set to "1" after an A/D converted value is stored. A read of a lower register (ADREGxL) will set this bit to "0." Bit 1 is the over RUN flag . It is set to "1" if a conversion result is overwritten before both conversion result storage registers (ADREGxH,ADREGxL) are read. A read of a flag will clear this bit to "0." When reading conversion result storage registers, first read upper registers and then read lower registers.
Fig. 16-5 Registers related to the A/D Converter (1 of 2)
TMP19A43(rev2.0) 16-7
Analog/Digital Converter
TMP19A43
Lower A/D Conversion Result Register 4C 7
ADREG4CL (0xFFFF_F308) bit Symbol Read/Write After reset Function ADR41 R 0 Store lower 2 bits of A/D conversion result "1" is read.
6
ADR40
5
4
R 1
3
2
1
OVR4 R 0
Over RUN flag 0: Not generate 1: Generate
0
ADR4RF R 0
A/D conversion result storage flag 1: Presence of conversion result
Upper A/D Conversion Result Register 4C 7
ADREG4CH (0xFFFF_F309) bit Symbol Read/Write After reset Function ADR49
6
ADR48
5
ADR47
4
ADR46 R 0
3
ADR45
2
ADR44
1
ADR43
0
ADR42
Store upper 8 bits of A/D conversion result
Lower A/D Conversion Result Register 5D 7
ADREG5DL (0xFFFF_F30A) bit Symbol Read/Write After reset Function ADR51 R 0 Store lower 2 bits of A/D conversion result "1" is read.
6
ADR50
5
4
R 1
3
2
1
OVR5 R 0
Over RUN flag 0: Not generate 1: Generate
0
ADR5RF R 0
A/D conversion result storage flag 1: Presence of conversion result
Upper A/D Conversion Result Register 5D 7
ADREG5DH (0xFFFF_F30B) bit Symbol Read/Write After reset Function 9 Converted channel x value ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2 ADREGxL 1 0 8 7 ADR59
6
ADR58
5
ADR57
4
ADR56 R 0
3
ADR55
2
ADR54
1
ADR53
0
ADR52
Store upper 8 bits of A/D conversion result 6 5 4 3 2 1 0
* * * *
Values read from bits 5 through 2 are always "1." Bit 0 is the A/D conversion result storage flag . It is set to "1" after an A/D converted value is stored. A read of a lower register (ADREGxL) will set this bit to "0." Bit 1 is the over Run flag . It is set to "1" if a conversion result is overwritten before both conversion result storage registers (ADREGxH and ADREGxL) are read. A read of a flag will clear this bit to "0." When reading conversion result storage registers, first read upper registers and then read lower registers.
TMP19A43(rev2.0) 16-8
Analog/Digital Converter
TMP19A43
Lower A/D Conversion Result Register 6E 7
ADREG6EL (0xFFFF_F30C) bit Symbol Read/Write After reset Function ADR61 R 0 Store lower 2 bits of A/D conversion result "1" is read.
6
ADR60
5
4
R 1
3
2
1
OVR6 R 0
Over RUN flag 0: Not generate 1: Generate
0
ADR6RF R 0
A/D conversion result storage flag 1: Presence of conversion result
Upper A/D Conversion Result Register 6E 7
ADREG6EH (0xFFFF_F30D) bit Symbol Read/Write After reset Function ADR69
6
ADR68
5
ADR67
4
ADR66 R 0
3
ADR65
2
ADR64
1
ADR63
0
ADR62
Store upper 8 bits of A/D conversion result
Lower A/D Conversion Result Register 7F 7
ADREG7FL (0xFFFF_F30E) bit Symbol Read/Write After reset Function ADR71 R 0 Store lower 2 bits of A/D conversion result "1" is read.
6
ADR70
5
4
R 1
3
2
1
OVR7 R 0
Over RUNflag 0: Not generate 1: Generate
0
ADR7RF R 0
A/D conversion result storage flag 1: Presence of conversion result
Upper A/D Conversion Result Register 7F 7
ADREG7FH (0xFFFF_F30F) bit Symbol Read/Write After reset Function 9 Converted channel x value ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2 ADREGxL 1 0 8 7 ADR79
6
ADR78
5
ADR77
4
ADR76 R 0
3
ADR75
2
ADR74
1
ADR73
0
ADR72
Store upper 8 bits of A/D conversion result 6 5 4 3 2 1 0
* * * *
Values read from bits 5 through 2 are always "1." Bit 0 is the A/D conversion result storage flag . It is set to "1" if an A/D converted value is stored. A read of a lower register (ADREGxL) will set this bit to "0." Bit 1 is the over Run flag . It is set to "1" if a conversion result is overwritten before both conversion result storage registers (ADREGxH and ADREGxL) are read. A read of a flag will clear this bit to "0." When reading conversion result storage registers, first read upper registers and then read lower registers.
TMP19A43(rev2.0) 16-9
Analog/Digital Converter
TMP19A43
Lower A/D Conversion Result Register SP 7
ADREGSPL (0xFFFF_F310) bit Symbol Read/Write After reset Function ADRSP1 R 0 Store lower 2 bits of A/D conversion result "1" is read.
6
ADRSP0
5
4
R 1
3
2
1
OVRSP R 0
Over RUN flag 0: Not generate 1: Generate
0
ADRSPRF R 0
A/D conversion result storage flag 1: Presence of conversion result
Upper A/D Conversion Result Register SP 7
ADREGSPH (0xFFFF_F311) bit Symbol Read/Write After reset Function ADRSP9
6
ADRSP8
5
ADRSP7
4
ADRSP6 R 0
3
ADRSP5
2
ADRSP4
1
ADRSP3
0
ADRSP2
Store upper 8 bits of A/D conversion result
9 Converted channel x value
8
7
6
5
4
3
2
1
0
ADREGxH 7 6 5 4 3 2 1 0 7 6 5 4 3 2
ADREGxL 1 0
* * * *
Values read from bits 5 through 2 are always "1." Bit 0 is the A/D conversion result storage flag . It is set to "1" after an A/D converted value is stored. A read of a lower register (ADREGxL) will set this bit to "0." Bit 1 is the over RUN flag . It is set to "1" if a conversion result is overwritten before both conversion result storage registers (ADREGxH and ADREGxL) are read. A read of a flag will clear this bit to "0." When reading conversion result storage registers, first read upper registers and then read lower registers.
TMP19A43(rev2.0) 16-10
Analog/Digital Converter
TMP19A43
Lower A/D Conversion Result Comparison Register 7
ADCOMREGL (0xFFFF_F312) bit Symbol Read/Write After reset Function ADR21 R/W 0 Store lower 2 bits of A/D conversion result comparison "0" is read.
6
ADR20
5
4
3
R 0
2
1
0
Upper A/D Conversion Result Comparison Register 7
ADCOMREGH (0xFFFF_F313) bit Symbol Read/Write After reset Function ADR29
6
ADR28
5
ADR27
4
ADR26 R/W 0
3
ADR25
2
ADR24
1
ADR23
0
ADR22
Store upper 8 bits of A/D conversion result comparison
(Note)
To set or change a value in this register, the AD monitor function must be disabled (ADMOD3="0").
TMP19A43(rev2.0) 16-11
Analog/Digital Converter
TMP19A43
16.2
Conversion Clock
The conversion time is calculated by the 46 conversion clock.
A/D Conversion Clock Setting Register 7 6
tSH2 R/W 0
5
tSH1 R/W 0
4
tSH0 R/W 0
3
R 0
"0" is read.
2
ADCLK2 R/W 0
000: fc 001: fc/2 010: fc/4 011: fc/8 100: fc/16 111: Reserved
1
ADCLK1 R/W 0
0
ADCLK0 R/W 0
ADCLK (0xFFFF_F31C)
bit Symbol Read/Write After reset
TSH3 R/W 1
Function
Select the A/D sample hold time 1000: 8 conversion clock 1010: 8x3 conversion clock 0011: 8x8 conversion clock 1100: 8x16 conversion clock
Select the A/D prescaler output
1001: 8x2 conversion clock 1011: 8x4 conversion clock 1101: 8x64 conversion clock
ADDCLK2:0
fc
/1
/2
/4
/8
/16
ADCLK
Example: If fsys = fc = 40 MHz
fc 40 MHz prescalar 1 1/2 1/4 tconv. (conversion time) 1.15 us 2.3 us 4.6 us
Variable S/H time
Conversion clock 40 MHz S/H time Conversion clk*8*1 Conversion clk*8*2 Conversion clk*8*3 Conversion clk*8*4 Conversion clk*8*8 Conversion clk*8*16 Conversion clk*8*64 (0.2 us) (0.4 us) (0.6 us) (0.8 us) (1.6 us) (3.2 us) (12.8 us) tconv. (conversion time) 1.15 us 1.35 us 1.55 us 1.75 us 2.55 us 4.15 us 13.75 us
"Please do not change the analog to digital conversion clock setting in the analog to digital translation. "
TMP19A43(rev2.0) 16-12
Analog/Digital Converter
TMP19A43
Description of Operations
16.2.1 Analog Reference Voltage
The "H" level of the analog reference voltage shall be applied to the VREFH pin, and the "L" level shall be applied to the VREFL pin. By writing "0" to the ADMOD1 bit, a switched-on state of VREFH-VREFL can be turned into a switched-off state. To start AD conversion, make sure that you first write "1" to the bit, wait for 3 s during which time the internal reference voltage should stabilize, and then write "1" to the ADMOD0 bit.
16.2.2
Selecting the Analog Input Channel
How the analog input channel is selected is different depending on A/D converter operation mode used. (1) Normal AD conversion mode If the analog input channel is used in a fixed state (ADMOD0="0"): One channel is selected from analog input pins AIN0 through AIN15 by setting ADMOD1 to an appropriate setting. If the analog input channel is used in a scan state (ADMOD0="1"): One scan mode is selected from 16 scan modes by setting ADMOD1 and ADSCN to appropriate settings. (2) Top-priority AD conversion mode One channel is selected from analog input pins AIN0 through AIN15 by setting ADMOD2 to an appropriate setting. After a reset, ADMOD0 is initialized to "0" and ADMOD1 is initialized to "0000." This initialization works as a trigger to select a fixed channel input through the AN0 pin. The pins that are not used as analog input channels can be used as ordinary input ports. If top-priority AD conversion is activated during normal AD conversion, normal AD conversion is discontinued, top-priority AD conversion is executed and completed, and then normal AD conversion is resumed. Example: A case in which repeat-scan conversion is ongoing at channels AIN0 through AIN3 with ADMOD0 set to "11" and ADMOD1 set to 0011, and toppriority AD conversion has been activated at AIN15 with ADMOD2=1111:
Top-priority AD has been activated
Conversion Ch
Ch0
Ch1
Ch2
Ch15
Ch2
Ch3
Ch0
TMP19A43(rev2.0) 16-13
Analog/Digital Converter
TMP19A43
16.2.3
Starting A/D Conversion
Two types of A/D conversion are supported: normal AD conversion and top-priority AD conversion. Normal AD conversion is software activated by setting ADMOD0 to "1." Top-priority AD conversion is software activated by setting ADMOD2 to "1." 4 operation modes are made available to normal AD conversion. In performing normal AD conversion, one of these operation modes must be selected by setting ADMOD0<2:1> to an appropriate setting. For top-priority AD conversion, only one operation mode can be used: fixed channel single conversion mode. Normal AD conversion can be activated using the HW activation source selected by ADMOD4, and top-priority AD conversion can be activated using the HW activation source selected by ADMOD4. If this bit is "0," normal and top-priority AD conversions are activated in response to the input of a falling edge through the ADTRG pin. If this bit is "1," normal AD conversion is activated in response to TB1TRG generated by the 16-bit timer 1, and top-priority AD conversion is activated in response to TB9TRG generated by the 16-bit timer 9. Software activation is still valid even after H/W activation has been authorized. (note) When an external trigger is used for the HW start source of a top priority analog to digital translation, an external trigger cannot usually be set as analog to digital translation HW start.
When normal A/D conversion starts, the A/D conversion Busy flag (ADMOD0) showing that A/D conversion is under way is set to "1." When top-priority A/D conversion starts, the A/D conversion Busy flag (ADMOD2) showing that A/D conversion is under way is set to "1." If normal A/D conversion is interrupted by top-priority A/D conversion, the value of the Busy flag for normal A/D conversion before the start of top-priority A/D conversion is retained. The value of the conversion completion flag EOCFN for normal A/D conversion before the start of top-priority A/D conversion can also be retained. (Note) Normal A/D conversion must not be activated when top-priority A/D conversion is under way. If activated when top-priority A/D conversion is under way, the top-priority A/D conversion completion flag cannot be set, and the flag for previous normal A/D conversion cannot be cleared.
To reactivate normal A/D conversion, a software reset (ADMOD4) must be performed before starting A/D conversion. The HW activation method must not be used to reactivate normal A/D conversion. If ADMOD2 is set to "1" during normal A/D conversion, ongoing A/D conversion is discontinued and top-priority A/D conversion starts; specifically, A/D conversion (fixed channel single conversion) is executed for a channel designated by ADMOD2<3:0>. After the result of this top-priority A/D conversion is stored in the storage register ADREGSP, normal A/D conversion is resumed. If HW activation of top-priority A/D conversion is authorized during normal A/D conversion, ongoing A/D conversion is discontinued when requirements for activation using a resource are met, and toppriority A/D conversion (fixed channel single conversion) starts for a channel designated by ADMOD2<3:0>. After the result of this top-priority A/D conversion is stored in the storage register ADREGSP, normal A/D conversion is resumed.
TMP19A43(rev2.0) 16-14
Analog/Digital Converter
TMP19A43
16.2.4
A/D Conversion Modes and A/D Conversion Completion Interrupts
For A/D conversion, the following four operation modes are supported. For normal A/D conversion, an operation mode can be selected by setting ADMOD0<2:1> to an appropriate setting. For top-priority A/D conversion, the fixed channel single conversion mode is automatically selected, irrespective of the ADMOD0<2:1> setting. Fixed channel single conversion mode Channel scan single conversion mode Fixed channel repeat conversion mode Channel scan repeat conversion mode (1) Normal A/D conversion An operation mode is selected with ADMOD0. As A/D conversion starts, ADMOD0 is set to "1." When specified A/D conversion is completed, the A/D conversion completion interrupt (INTAD) is generated, and ADMOD0 showing the completion of A/D conversion is set to "1." If ="0," returns to "0" concurrently with the setting of EOCF. If is set to "1," remains at "1" and A/D conversion continues. Fixed channel single conversion mode If ADMOD0 is set to "00," A/D conversion is performed in the fixed channel single conversion mode. In this mode, A/D conversion is performed once for one channel selected. After A/D conversion is completed, ADMOD0 is set to "1," ADMOD0 is cleared to "0," and the interrupt request INTAD is generated. is cleared to "0" upon read. Channel scan single conversion mode If ADMOD0 is set to "01," A/D conversion is performed in the channel scan single conversion mode. In this mode, A/D conversion is performed once for each scan channel selected. After A/D scan conversion is completed, ADMOD0 is set to "1," ADMOD0 is cleared to "0," and the interrupt request INTAD is generated. is cleared to "0" upon read. Fixed channel repeat conversion mode If ADMOD0 is set to "10," A/D conversion is performed in fixed channel repeat conversion mode. In this mode, A/D conversion is performed repeatedly for one channel selected. After A/D conversion is completed, ADMOD is set to "1." ADMOD0 is not cleared to "0." It remains at "1." The timing with which the interrupt request INTAD is generated can be selected by setting ADMOD0 to an appropriate setting. is set with the same timing as this interrupt INTAD is generated. is cleared to "0" upon read. With set to "00," an interrupt request is generated each time one A/D conversion is completed. In this case, the conversion results are always stored in the storage register ADREG08. After the conversion result is stored, EOCF changes to "1." With set to "01," an interrupt request is generated each time four A/D conversion are completed. In this case, the conversion results are sequentially stored in storage registers ADREG08 through ADREG3B. After the conversion results are stored in ADREG3B, is set to "1," and the storage of subsequent conversion results starts from ADREG08. is
TMP19A43(rev2.0) 16-15
Analog/Digital Converter
TMP19A43
cleared to "0" upon read. With set to "10," an interrupt request is generated each time eight A/D conversions are completed. In this case, the conversion results are sequentially stored in storage registers ADREG08 through ADREG7F. After the conversion results are stored in ADREG7F, is set to "1," and the storage of subsequent conversion results starts from ADREG08. is cleared to "0" upon read. Channel scan repeat conversion mode If ADMOD0 is set to "11," A/D conversion is performed in the channel scan repeat conversion mode. In this mode, A/D conversion is performed repeatedly for a scan channel selected. Each time one A/D scan conversion is completed, ADMOD0 is set to "1," and the interrupt request INTAD is generated. ADMOD0 is not cleared to "0." It remains at "1." is cleared to "0" upon read. To stop the A/D conversion operation in the repeat conversion mode (modes described in and above), write "0" to ADMOD0 . When ongoing A/D conversion is completed, the repeat conversion mode terminates, and ADMOD0 is set to "0." Before switching from one mode to standby mode (such standby modes as IDLE, STOP, etc.), check that A/D conversion is not being executed. If A/D conversion is under way, you must stop it or wait until it is completed. (2) Top-priority A/D conversion Top-priority A/D conversion is performed only in fixed channel single conversion mode. The ADMOD0 setting has no relevance to the top-priority A/D conversion operations or preparations. As activation requirements are met, A/D conversion is performed only once for a channel designated by ADMOD2. After the A/D conversion is completed, the top-priority A/D conversion completion interrupt is generated, ADMOD2 is set to "1," and returns to "0." The EOCFHP Flag is cleared upon read.
TMP19A43(rev2.0) 16-16
Analog/Digital Converter
TMP19A43
Relationships between A/D Conversion Modes, Interrupt Generation Timings and Flag Operations
Conversion mode Fixed channel single conversion Fixed channel repeat conversion Interrupt generation timing After conversion is completed Each time one conversion is completed Each time four conversions are completed Each time eight conversions are completed After scan conversion is completed Each time one scan conversion is completed EOCF setting timing (see Note) After conversion is completed After one conversion is completed After four conversions are completed After eight conversions are completed After scan conversion is completed After one scan conversion is completed ADBF ADMOD0 (after the interrupt ITM1:0 REPEAT SCAN is generated) 0 1 1 00 01 0 1 0 0
1
10
Channel scan single conversion Channel scan repeat conversion
0 1

0 1
1 1
(Note)
EOCF is cleared upon read.
TMP19A43(rev2.0) 16-17
Analog/Digital Converter
TMP19A43
16.2.5
High-priority Conversion Mode
By interrupting ongoing normal A/D conversion, top-priority A/D conversion can be performed. Toppriority A/D conversion can be software activated by setting ADMOD2 to "1" or it can be activated using the HW resource by setting ADMOD4<7:6> to an appropriate setting. If top-priority A/D conversion has been activated during normal A/D conversion, ongoing normal A/D conversion is interrupted, and single conversion is performed for a channel designated by ADMOD2<3:0>. The result of single conversion is stored in ADREGSP, and the top-priority A/D conversion interrupt is generated. After top-priority A/D conversion is completed, normal A/D conversion is resumed; the status of normal A/D conversion immediately before being interrupted is maintained. Top-priority A/D conversion activated while top-priority A/D conversion is under way is ignored. For example, if channel repeat conversion is activated for channels AN0 through AN8 and if is set to "1" during AN3 conversion, AN3 conversion is suspended, and conversion is performed for a channel designated by . After the result of conversion is stored in ADREGSP, channel repeat conversion is resumed, starting from AN3.
16.2.6
A/D Monitor Function
If ADMOD3 is set to "1," the A/D monitor function is enabled. If the value of the conversion result storage register specified by REGS<3:0> becomes larger or smaller ("larger" or "smaller" to be designated by ADOBIC) than the value of a comparison register, the A/D monitor function interrupt is generated. This comparison operation is performed each time a result is stored in a corresponding conversion result storage register, and the interrupt is generated if the conditions are met. Because storage registers assigned to perform the A/D monitor function are usually not read by software, overrun flag is always set and the conversion result storage flag is also set. To use the A/D monitor function, therefore, a flag of a corresponding conversion result storage register must not be used.
16.2.7
Storing and Reading A/D Conversion Results
A/D conversion results are stored in upper and lower A/D conversion result registers for normal A/D conversion (ADREG08H/L through ADRG7FH/L). In fixed channel repeat conversion mode, A/D conversion results are sequentially stored in ADREG08H/L through ADREG7FH/L. If is so set as to generate the interrupt each time one A/D conversion is completed, conversion results are stored only in ADREG08H/L. If is so set as to generate the interrupt each time four A/D conversions are completed, conversion results are sequentially stored in ADREG08H/L through ADREG3BH/L. Table 16. 1 shows analog input channels and related A/D conversion result registers.
TMP19A43(rev2.0) 16-18
Analog/Digital Converter
TMP19A43
Table 16-1 Analog Input Channels and Related A/D Conversion Result Registers
A/D conversion result register Analog input channel Conversion Fixed channel repeat Fixed channel repeat modes other conversion mode conversion mode (port A) than shown (every one (every four to the right conversion) conversions)
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN8 AN9 AN10 AN11 AN12 AN13 AN14 AN15 ADREG08H/L ADREG08H/L fixed ADREG19H/L ADREG2AH/L ADREG3BH/L ADREG4CH/L ADREG5DH/L ADREG6EH/L ADREG7FH/L ADREG08H/L ADREG19H/L ADREG2AH/L ADREG3BH/L ADREG4CH/L ADREG5DH/L ADREG6EH/L ADREG7FH/L
ADREG08H/L
Fixed channel repeat conversion mode (every eight conversions)
ADREG08H/L
ADREG3BH/L
ADREG7FH/L
16.2.8
Data Polling
To process A/D conversion results without using interrupts, ADMOD0 must be polled. If this flag is set, conversion results are stored in a specified A/D conversion result register. After confirming that this flag is set, read that conversion result storage register. In reading the register, make sure that you first read upper bits and then lower bits to detect an overrun. If OVRn is "0" and ADRnRF is "1" in lower bits, a correct conversion result has been obtained.
TMP19A43(rev2.0) 16-19
Analog/Digital Converter
TMP19A43
17. Digital/Analog Converter
This section describes the D/A converter that is built into the TMP19A43.
17.1 Features
* * * A high-resolution, 8-bit D/A converter is built into each of two channels of the TM19A43. Each channel is provided with a buffer amplifier. Each channel can be individually put into standby mode by making an appropriate control register setting.
17.2 Operation (about the Operation of the D/A Converter)
Basic settings: * * * * Set the control register DACCNTn to <1:1>. Assign an output CODE to the output register DAREGn so that an output voltage specified for that CODE appears at the output pin DAn. Set DACCNTn to "0," and the output pin DAn goes into Power Down mode. (The electric potential of the pin becomes equal to that of the DAVREF power supply.) By setting DACCNTn to "0," Iref can be cut and a consumption current can be reduced. DAVREF DAVCC DAGND
REFONn + - DA0,1
100pF (max.)
CVREF DAGND OPEN
(note)Please open the terminal CVREF.
Fig. 17.2.1 D/A Converter Block Diagram
TMP19A43(rev2.0) 17-1
Digital/Analog Converter
TMP19A43
DACCNT0 Register
7
DACCNT0 (0xFFFF_F330) Bit Symbol Read/Write After reset Function "0" is read. 0
6
5
4
3
2
1
REFON0 R/W 0 0: Ref off 1: Ref on
0
OP0 R/W 0 0: Power Down 1: Output
Output Register DAREG0
7
DAREG0 (0xFFFF_F331) Bit Symbol Read/Write After reset Function DAC7
6
DAC6
5
DAC5
4
DAC4 R/W 0
3
DAC3
2
DAC2
1
DAC1
0
DAC0
DACCNT1 Register
7
DACCNT1 (0xFFFF_F338) Bit Symbol Read/Write After reset Function "0" is read. 0
6
5
4
3
2
1
REFON1 R/W 0 0: Ref off 1: Ref on
0
OP1 R/W 0 0: Power Down 1: Output
Output Register DAREG1
7
DAREG1 (0xFFFF_F339) Bit Symbol Read/Write After reset Function DAC7
6
DAC6
5
DAC5
4
DAC4 R/W 0
3
DAC3
2
DAC2
1
DAC1
0
DAC0
* * *
When setting REFONn to "0," OPn must also be set to "0." After "0" of REFONn is changed "1," wait for 10sec(open the terminal CVREF) msec during which time circuitry stabilizes. All voltages in the range from DAGND through DAVCC (DAVREF) cannot be output. A correct range of output voltages must be verified by checking the electrical characteristics which are later described.
* (note 3)100s(typ.) is necessary by the time the voltage output to DAn after output CODE is set is steady.
TMP19A43(rev2.0) 17-2
Digital/Analog Converter
TMP19A43
18. Watchdog Timer (Runaway Detection Timer)
The TMP19A43 has a built-in watchdog timer for detecting runaways. The watchdog timer (WDT) is for detecting malfunctions (runaways) of the CPU caused by noises or other disturbances and remedying them to return the CPU to normal operation. If the timer detects a runaway, it generates a non-maskable interrupt to notify the CPU. By connecting the output of the watchdog timer to a reset pin (inside the chip), it is possible to force the watchdog timer to reset itself.
18.1 Configuration
Fig. 18.1 shows the block diagram of the watchdog timer.
WDMOD
RESET pin
Reset control
Internal reset
Interrupt request INTWDT WDMOD
16
Selector
2 fSYS/2
2
18
2
20
2
22
Binary counter (22 stages) Reset
Q R S
Internal reset Write 4EH Write B1H WDMOD
Watchdog timer control register WDCR
Internal data bus
Fig. 18.1 Block Diagram of the Watchdog Timer
TMP19A43(rev2.0) 18-1 Watchdog Timer (Runaway Detection Timer)
TMP19A43
18.2 Watchdog Timer Interrupt
The watchdog timer consists of the binary counters that are arranged in 22 stages and work using the fSYS/2 system clock as an input clock. The outputs produced by these binary counters are 216, 218, 220 and 222. By selecting one of these outputs with WDMOD , a watchdog timer interrupt can be generated when an overflow occurs, as shown in Fig. 18.. Because the watchdog timer interrupt is a non-maskable interrupt factor, NMIFLG at the INTC performs a task of identifying it.
WDT counter
n
Overflow
0
WDT interrupt Write of a clear code WDT clear
Fig. 18.2 Normal Mode When an overflow occurs, resetting the chip itself is an option to choose. If the chip is reset, a reset is effected for a 32-state time, as shown in Fig. 18.. If this reset is effected, the clock fSYS that the clock gear generates by dividing the clock fC of the high-speed oscillator by 8 is used as an input clock fSYS/2.
Overflow WDT counter n
WDT interrupt
Internal reset
32-state (12.8 s @ fC = 40 MHz, fsys = 5 MHz, fsys/2 = 2.5 MHz)
Fig. 18.3 Reset Mode
TMP19A43(rev2.0) 18-2 Watchdog Timer (Runaway Detection Timer)
TMP19A43
18.3 Control Registers
The watchdog timer (WDT) is controlled by two control registers WDMOD and WDCR.
18.3.1
Watchdog Timer Mode Register (WDMOD)
Specifying the detection time of the watchdog timer This is a 2-bit register for specifying the watchdog timer interrupt time for runaway detection. When a reset is effected, this register is initialized to WDMOD = "00." Fig. 18.1 shows the detection time of the watchdog timer. Enabling/disabling the watchdog timer When reset, WDMOD is initialized to "1" and the watchdog timer is enabled. To disable the watchdog timer, this bit must be set to "0" and, at the same time, the disable code (B1H) must be written to the WDCR register. This dual setting is intended to minimize the probability that the watchdog timer may inadvertently be disabled if a runaway occurs. To change the status of the watchdog timer from "disable" to "enable," set the bit to "1." Watchdog timer out reset connection This is a register for specifying whether or not to reset the watchdog timer itself after a runaway is detected. As a reset initializes this setting to WDMOD ="0," a reset initiated the output of the watchdog timer is not performed.
18.3.2
Watchdog Timer Control Register (WDCR)
This is a register for disabling the watchdog timer function and controlling the clearing function of the binary counter. * Disabling control By writing the disable code (B1H) to this WDCR register after setting WDMOD to "0," the watchdog timer can be disabled.
WDMOD WDCR 0
-------
10110001
Clears WDTE to "0." Writes the disable code (B1H).
*
Enabling control Set WDMOD to "1."
*
Watchdog timer clearing control Writing the clear code (4EH) to the WDCR register clears the binary counter and allows it to resume counting.
WDCR 01001110
Writes the clear code (4EH)
(Note)
Writing the disable code (BIH) clears the binary counter.
TMP19A43(rev2.0) 18-3 Watchdog Timer (Runaway Detection Timer)
TMP19A43
7
bit Symbol WDMOD (0xFFFF_F090) Read/Write After reset Function WDTE R/W 1 WDT control 1: Enable
6
WDTP1
5
WDTP0
4
3
2
I2WDT R/W 0 IDLE 0: Stop 1: Start
1
RESCR 0 1: Internally connect WDT output to reset pin
0
R/W 0 Write "0."
R/W 0 0 Selects WDT detection time 00: 2 /fSYS 01: 2 /fSYS 10: 2 /fSYS 11: 2 /fSYS
22 20 18 16
R 0 "0" is read.
Watchdog timer out control 0 1 Generates NMI interrupt Connects WDT out to reset
Detection time of watchdog timer
SYSCR1 clock gear value 000 (fc) 100 (fc/2) 110 (fc/4) 111 (fc/8)
@ fc = 40 MHz
WDMOD
Detection Time of Watchdog Timer
00 1.6 ms 3.3 ms 6.5 ms 13.1 ms
01 6.5 ms 13.1 ms 26.2 ms 52.4 ms
10 26.2 ms 52.4 ms 105 ms 209 ms
11 105 ms 210 ms 419 ms 839 ms
Enable/disable control of the watchdog timer 0 1 Disable Enable
Fig. 18.4 Watchdog Timer Mode Register
7
bit Symbol WDCR (0xFFFF_F091) Read/Write After reset Function
6
5
4
W
3
2
1
0
B1H : WDT disable code 4EH : WDT clear code
Disable & clear of WDT B1H 4EH Others Disable code Clear code
Fig. 18.5 Watchdog Timer Control Register
TMP19A43(rev2.0) 18-4 Watchdog Timer (Runaway Detection Timer)
TMP19A43
18.4 Operation Description
The watchdog timer generates the INTWDT interrupt after a lapse of the detection time specified by the WDMOD register. Before generating the INTWD interrupt, the binary counter for the watchdog timer must be cleared to "0" using software (instruction). If the CPU malfunctions (runs away) due to noise or other disturbances and cannot execute the instruction to clear the binary counter, the binary counter overflows and the INTWD interrupt is generated. The CPU is able to recognize the occurrence of a malfunction (runaway) by identifying the INTWD interrupt and to restore the faulty condition to normal by using a malfunction (runaway) countermeasure program. Additionally, it is possible to resolve the problem of a malfunction (runaway) of the CPU by connecting the watchdog timer out pin to reset pins of peripheral devices. The watchdog timer begins operation immediately after a reset is cleared. In STOP mode, the watchdog timer is reset and in an idle state. When the bus is open ( BUSAK = "L"), it continues counting. In IDLE mode, its operation depends on the WDMOD setting. Before putting it in IDLE mode, WDMOD must be set to an appropriate setting, as required. Examples: To clear the binary counter
WDCR 76543210 01001110
Writes the clear code (4EH)
To set the detection time of the watchdog timer to 218/fSYS
WDMOD 76543210 101-----
To disable the watchdog timer
WDMOD WDCR 76543210 0------- 10110001
Clears WDTE to "0" Writes the disable code (B1H)
Note:
If the watchdog timer is operated when the high-frequency oscillator is idle, the system reset operation initiated by the watchdog timer becomes erratic due to the unstable oscillation of the high-frequency oscillator. Therefore, do not operate the watchdog timer when the high-frequency oscillator is idle.
TMP19A43(rev2.0) 18-5 Watchdog Timer (Runaway Detection Timer)
TMP19A43
19. Clock Timer
19.1 Features
TMP19A43 can be used in these operation modes. This clock timer using a low clock frequency of 32.768 kHz can generate interrupts at time intervals of 0.125s, 0.250s, 0.500s and 1.000s so that the TMP19A43 is able to use the clock function when operating in low-powerdissipation operation modes. This clock timer can be operated in all operation modes of low-frequency oscillation. The interrupt generated by this clock allows the TMP19A43 to recover from standby mode (except STOP mode) and return to normal operation mode. To use the clock timer interrupt (INTRTC), the IMCGD register in the CG must be set to an appropriate setting. Fig. 19-1 shows the block diagram of the clock timer.
RTCCR RTCCR /CLEAR RUN fs (32.768 kHz) /CLEAR 2
Selector
Interrupt request INTRTC 32-bit cumulative register
12
2
13
2
14
2
15
RTCREG
15-stage binary counter
Fig. 19-1 Block Diagram of the Clock Timer
Note:A built-in register is initialized by reset with the terminal RESET. On the other hand, When resetting it by WDT and DSU, it is not initialized.
TMP19A43(rev2.0) 19-1
Clock Timer
TMP19A43
Register
The clock timer is controlled by the clock timer control register (RTCCR). Fig. 19-2 shows the clock timer control register.
(fs = 32.768 kHz) 7 RTCCR LITTLE BIG Bit Symbol R/W 0 Write "0." R/W 0 Write "0." R 0 "0" is read. 0 (0xFFFF_E704) Read/Write (0xFFFF_E707) After reset Function 6 5 4 3 RTCRCLR W 0
Clear cumulative register 0: Clear 1: Don't Care
2 RTCSEL1 R/W
1 RTCSEL0
0 RTCRUN R/W 0
Binary counter 0: Stop & clear 1: Count
0 0 Interrupt generation cycle 15 00: 2 /fs (1.000 s) 14 01: 2 /fs (0.500 s) 13 10: 2 /fs (0.250 s) 12 11: 2 /fs (0.125 s) 10 9
15 Bit Symbol Read/Write After reset Function Bit Symbol Read/Write After reset Function Bit Symbol Read/Write After reset Function 0 31
14
13
12 R
11
8
0 23
0 22
0 21
0 20 R
0 19
0 18
0 17
0 16
0 30
0 29
0 28 R
0 27
0 26
0 25
0 24
0
0
0
0
0
0
0
0
Fig. 19-2 Clock Timer Control Register
(Note 1) To access this register, 32-bit access is required. (Note 2) Values read from RTCCR are always "1." (Note 3) Before changing the RTCCR setting, make sure that RTCCR is "0" and that the RTC interrupt is disabled. (Note 4) A built-in register is initialized by reset with the terminal RESET. When resetting it by WDT and DSU, it is not initialized.
TMP19A43(rev2.0) 19-2
Clock Timer
TMP19A43
The clock timer is provided with a clock count cumulative register for counting the number of times interrupts are generated. Clock Count Cumulative Register
7 Bit Symbol RTCREG Read/Write (0xFFFF_E708) After reset Function Bit Symbol Read/Write After reset Function Bit Symbol Read/Write After reset Function 31 Bit Symbol Read/Write After reset Function RUI31 0 30 RUI30 0 29 RUI29 0 RUI7 0 15 RUI15 0 23 RUI23 0 6 RUI6 0 14 RUI14 0 22 RUI22 0 5 RUI5 0 13 RUI13 0 21 RUI21 0 4 RUI4 3 RUI3 2 RUI2 0 10 RUI10 0 18 RUI18 0 26 RUI26 0 1 RUI1 0 9 RUI9 0 17 RUI17 0 25 RUI25 0 0 RUI0 0 8 RUI8 0 16 RUI16 0 24 RUI24 0
R/W 0 0 Accumulate count value 12 RUI12 R/W 0 0 Accumulate count value 20 RUI20 R/W 0 28 RUI28 0 27 RUI27 Accumulate count value 19 RUI19 11 RUI11
R/W 0 0 Accumulate count value
Fig. 19-3 Clock Count Cumulative Register (Note 1) A write to this cumulative register clears the prescaler. (Note 2) Interrupts must be disabled during a read. (Note 3) To access this register, 32-bit access is required.
TMP19A43(rev2.0) 19-3
Clock Timer
TMP19A43
Example of the clock timer interrupt setting: Initialization
IMCD RTCCR 76543210 00010000 0000XXX0
IMCGD 00100001 EICRCG 0 0 0 0 1 1 0 1 INTCLR RTCCR IMCD 11110000 00001XX1 00010XXX
Disables the interrupt INTRTC Sets the bit <15:8> of a 32-bit register Stops the RTC timer count Sets the bit <7:0> of a 32-bit register Sets the bit <15:8> of a 32-bit register Clears the interrupt request for the CG block Set the bit <7:0> of a 32-bit register Clears the interrupt request for the INTC block Sets the bit <8:0> of a 32-bit register Starts the timer count Sets the bit <7:0> of a 32-bit register Sets the interrupt level Set the bit <15:8> of a 32-bit register
INTRTC interrupt
EICRCG INTCLR 76543210 00001101 11110000
Clears the interrupt request for the CG block Sets the bit <7:0> of a 32-bit register Clears the interrupt request for the INTC block Sets the bit <8:0> of a 32-bit register
Processing Interruption finished
(Note 1) X means "don't care." (Note 2) To disable interrupts, IMCE must be first set and then IMCGD.
TMP19A43(rev2.0) 19-4
Clock Timer
TMP19A43
20. Key-on Wakeup Circuit
20.1 Outline
* The TMP19A43 has 32 key inputs, KEY00 to KEY31, which can be used for releasing the STOP mode or for external interrupts. Note that interrupt processing is executed with one interrupt factor for the 32 inputs. (This is programmed in the CG block.) Each key input can be configured to be used or not, by programming (KWUPSTn). The active state of each input can be configured to the rising edge, the falling edge, both edges, the high level or the low level, by programming (KWUPSTn). An interrupt request is cleared by programming the key interrupt request clear register KWUPCLR in the interrupt processing. The key input pins have pull-up functions, which can be switched between static pull-up and dynamic pull-up by programming the (KWUPSTn) bit. This programming is needed for each of 32 inputs.
INT
Static Pull-up Dynamic Pull-up
1 1 RD Clr
* * *
KEYEN
KWUPINT
KUPIN fs
1
IPH Level/Edge
1 RD Clr
IPH
DPUP fs

PKEY
IPH IPH
1

High/Low Level
20.2 Key-on Wakeup Operation
The TMP19A43 has 32 key input pins, KEY00 to KEY31. Program the IMCGD3 register in the CG to determine whether to use the key inputs for releasing the STOP mode or for normal interrupts. Setting to "1" causes all the key inputs, KEY00 to KEY31, to be used for interrupts for releasing the STOP mode. Program KWUPSTn to enable or disable interrupt inputs for each key input pin. Also, program KWUPSTn to define the active state of each key input pin to be used. Detection of key inputs is carried out in the KWUP block, and the detection results are notified to the IMCGD3 register in the CG as the active high level. Therefore, program IMCGD3 to "01" to determine the detection level to the high level. The results of detection in the CG are also notified to the interrupt controller INTC as the active high level. Therefore, program the INTC to "01" to define the corresponding interrupt as the high level. Setting IMCGD3 to 0 (default) configures all the input pins, KEY00 to KEY31 to the normal interrupts. In this case, you don't have to make settings at the CG, but just specify the INTC detection level to the high level. Program KWUPSTn in the same way to enable or disable each key input and define their active states. Writing "1010" to KWUPCLR during interrupt processing clears all the key interrupt requests. (Note) If two or more key inputs are generated, all the key input requests will be cleared by clearing interrupt requests.
TMP19A43(rev2.0)20-1
Key-on Wakeup Circuit
TMP19A43
20.3 Pull-up Function
Each key input has the pull-up function and can be programmed by setting the register in the port. When a static pull-up is set, can it not depend on KWUPSTn and the pull-up be used.
20.3.1
Cautions on Use of Key Inputs With Pull-up Enabled
A) When you make the first setting after turning the power ON (Example: port E0 with interrupts at both edges) 1) Make a setting of the port. PEFC = "1" PEPE = "1" 2) 3) 4) 5) 6) 7) The function is set to the key. Pull-up ON control
Set KWUPST08 to "0" for the key input to be used. Set KWUPST08 to "100" to define the active state of the key input to be used. Set KWUPST08 to "1" for the key input to be used. Wait until the pull-up operation is completed. Set KWUPCLR to "1010" to clear interrupt requests. Program the CG and the INTC by setting IMCGD3 to "01" and IMCGD3 to "1." (Refer to Chapter 6, "Interrupt Settings" for the details of setting methods.)
B) To change the active state of a key input during operation 1) 2) 3) 4) 5) 6) Set KWUPST08 to "0" for the key input to be used. Disable key interrupts by setting IMC4 to "000" at the INTC. Set KWUPST08 to "1" for the key input to be used. Change the active state by setting KWUPST08 to "000" for the key input to be changed. (Example: Lo level interrupt) Clear interrupt requests by setting KWUPCLR to "1010." Enable the key interrupt at the INTC. Set IMC4 to a desired level "xxx."
C) To enable a key input during operation 1) 2) 3) 4) 5) 6) 7) Disable key interrupts by setting IMC4 to "000" at the INTC. Set KWUPSTn to "0" for the key input to be used. Define the active state of the key input to be used at the corresponding KWUPSTn. Set KWUPSTn to "1" for the key input to be used. Wait until the pull-up operation is completed. Clear interrupt requests by setting KWUPCLR. Enable key interrupts at the INTC. (Set IMC4 to a desired level.)
TMP19A43(rev2.0)20-2
Key-on Wakeup Circuit
TMP19A43
20.3.2
Cautions on Use of Key Inputs With Pull-up Disabled
A) When you make the first setting after turning the power ON 1) 2) 3) 4) 5) 6) Set PEPE to "0" to select the pull-up OFF control. Set KWUPSTn to "0" for the key input to be used. Set KWUPST08 to "000" to define the active state of the key input to be used. Set KWUPSTn to "1" for the key input to be used. Set KWUPCLR to "1010" to clear interrupt requests. Program the CG and the INTC. (Refer to Chapter 6, "Interrupt Settings" for the details of setting methods.)
B) To change the active state of a key input during operation 1) 2) 3) 4) 5) 6) Disable key interrupts by setting IMC4 to "000" at the INTC. Set KWUPSTn to "0" for the key input to be used. Change the active state by setting KWUPSTn for the key input to be changed. Set KWUPSTn to "1" for the key input to be used. Clear interrupt requests by setting KWUPCLR. Enable key interrupts at the INTC. (Set IMC4 to a desired level.)
C) To enable a key input during operation 1) 2) 3) 4) 5) 6) Disable key interrupts by setting IMC4 to "000" at the INTC. Set KWUPSTn to "0" for the key input to be used. Define the active state by setting KWUPSTn for the key input to be used. Set KWUPSTn to "1" for the key input to be used. Clear interrupt requests by setting KWUPCLR. Enable key interrupts at the INTC. (Set IMC4 to a desired level.)
TMP19A43(rev2.0)20-3
Key-on Wakeup Circuit
TMP19A43
Key-on Wakeup Control
7 KWUPCNT Bit Symbol (0xFFFF_F384) Read/Write After reset Function R/W 0 6 R 0 5 T2S1 0 4 T2S0 R/W 0 0 0 Dynamic pull-up cycle 00: 256/fs 10: 1024/fs 01: 512/fs 11: 2048/fs Dynamic pull-up duration 00: 2/fs 10: 8/fs 01: 4/fs 11: 16/fs 3 T1S1 2 T1S0 R 0 This can be read as "0." 1 0
Make sure This can be read as "0." that you write "0."
Dynamic pull-up operation is executed as shown below.
T1 T2
Pull-up is executed only in the T1 period determined by . Pull-up is not executed in the remaining period. 00: 2/fs (62.5 s @fs = 32 kHz) 01: 4/fs (125 s @fs = 32 kHz) 10: 8/fs (250 s @fs = 32 kHz) 11: 16/fs (500 s @fs = 32 kHz) Dynamic pull-up operation is repeated in the T2 cycle determined by . 00: 256/fs (8 ms @fs = 32 kHz) 01: 512/fs (16 ms @fs = 32 kHz) 10: 1024/fs (32 ms @fs = 32 kHz) 11: 2048/fs (64 ms @fs = 32 kHz)
fs must be operated while dynamic pull-up is used.
TMP19A43(rev2.0)20-4
Key-on Wakeup Circuit
TMP19A43
20.4 Key Input Detection Timing
1) When the static pull-up is selected by setting PnPE to 1 and KWUPSTn to 0: The active state of each key input can be defined to the high or low level or to the rising and/or falling edges by setting KWUPSTn. The active states of key inputs are continuously detected. 2) When the dynamic pull-up is selected by setting PnPE to 1 and KWUPSTn to 1: Detection of the active state of each key input (interrupt detection) is carried out only at the edge one-clock before fs at the end of the T1 period. Therefore, a key input not shorter than the T2 period is needed. In this case, do not define the active state to the high or low level. There is a delay up to the T2 period before key input detection. The figure below shows an example of defining the active state to the falling edge.
Pull-up(T1) (T2) T2 period or longer is required (L period) Key input H or High-Z H or High-Z or L
Interrupt detection timing Key input detection
Internal sampling results
TMP19A43(rev2.0)20-5
Key-on Wakeup Circuit
TMP19A43
The external state of port value can be monitored during dynamic pull-up operation by referring to the PKEYn register. Sampling is executed in the dynamic pull-up cycle.
7 PKEY0 (0xFFFF_F380) Bit Symbol Read/Write After reset Function PKEY07 0 Port state 0: "Lo" 1: "Hi" 7 PKEY1 (0xFFFF_F381) Bit Symbol Read/Write After reset Function PKEY15 0 Port state 0: "Lo" 1: "Hi" 7 PKEY2 (0xFFFF_F382) Bit Symbol Read/Write After reset Function PKEY23 0 Port state 0: "Lo" 1: "Hi" 7 PKEY3 (0xFFFF_F383) Bit Symbol Read/Write After reset Function PKEY31 0 Port state 0: "Lo" 1: "Hi" 6 PKEY06 0 Port state 0: "Lo" 1: "Hi" 6 PKEY14 0 Port state 0: "Lo" 1: "Hi" 6 PKEY22 0 Port state 0: "Lo" 1: "Hi" 6 PKEY30 0 Port state 0: "Lo" 1: "Hi" 5 PKEY05 0 Port state 0: "Lo" 1: "Hi" 5 PKEY13 0 Port state 0: "Lo" 1: "Hi" 5 PKEY21 0 Port state 0: "Lo" 1: "Hi" 5 PKEY29 0 Port state 0: "Lo" 1: "Hi" 4 PKEY04 R 0 Port state 0: "Lo" 1: "Hi" 4 PKEY12 R 0 Port state 0: "Lo" 1: "Hi" 4 PKEY20 R 0 Port state 0: "Lo" 1: "Hi" 4 PKEY28 R 0 Port state 0: "Lo" 1: "Hi" 0 Port state 0: "Lo" 1: "Hi" 0 Port state 0: "Lo" 1: "Hi" 0 Port state 0: "Lo" 1: "Hi" 0 Port state 0: "Lo" 1: "Hi" 0 Port state 0: "Lo" 1: "Hi" 3 PKEY27 0 Port state 0: "Lo" 1: "Hi" 2 PKEY26 0 Port state 0: "Lo" 1: "Hi" 1 PKEY25 0 Port state 0: "Lo" 1: "Hi" 0 PKEY24 0 Port state 0: "Lo" 1: "Hi" 3 PKEY19 0 Port state 0: "Lo" 1: "Hi" 2 PKEY18 0 Port state 0: "Lo" 1: "Hi" 1 PKEY17 0 Port state 0: "Lo" 1: "Hi" 0 PKEY16 0 Port state 0: "Lo" 1: "Hi" 3 PKEY11 0 Port state 0: "Lo" 1: "Hi" 2 PKEY10 0 Port state 0: "Lo" 1: "Hi" 1 PKEY09 0 Port state 0: "Lo" 1: "Hi" 0 PKEY08 3 PKEY03 2 PKEY02 1 PKEY01 0 PKEY00
TMP19A43(rev2.0)20-6
Key-on Wakeup Circuit
TMP19A43
7 KWUPST00 bit Symbol DPE00 (0xFFFF_F360) Read/Write After reset Function
6 KEY002
5 KEY001
4 KEY000
3
2
1
0 KEY00EN R/W 0 KEY00 interrupt input 0: Disable 1: Enable
R/W 0 0 1 0 Pull-up Define the KEY00 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY012 5 KEY011 4 KEY010 DPE01
R 0 This can be read as "0."
3
2
1
0 KEY01EN R/W 0 KEY01 interrupt input 0: Disable 1: Enable
KWUPST01
bit Symbol
(0xFFFF_F361) Read/Write After reset Function
R/W 0 0 1 0 Pull-up Define the KEY01 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY022 0 R/W 0 1 0 Pull-up Define the KEY02 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY032 R/W 0 0 1 0 Pull-up Define the KEY03 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 5 KEY031 4 KEY030 DPE03 5 KEY021 4 KEY020 DPE02
R 0 This can be read as "0."
3
2 R 0
1
0 KEY02EN R/W 0 KEY02 interrupt input 0: Disable 1: Enable
KWUPST02
bit Symbol
(0xFFFF_F362) Read/Write After reset Function
This can be read as "0."
3
2 R
1
0 KEY03EN R/W 0 KEY03 interrupt input 0: Disable 1: Enable
KWUPST03
bit Symbol After reset Function
(0xFFFF_F363) Read/Write
0 This can be read as "0."
TMP19A43(rev2.0)20-7
Key-on Wakeup Circuit
TMP19A43
7 KWUPST04 bit Symbol DPE04 (0xFFFF_F364) Read/Write After reset Function
6 KEY042
5 KEY041
4 KEY040
3
2
1
0 KEY04EN R/W 0 KEY04 interrupt input 0: Disable 1: Enable
R/W 0 1 0 Pull-up Define the KEY04 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY052 5 KEY051 4 KEY050 DPE05
R 0 This can be read as "0."
3
2
1
0 KEY05EN R/W 0 KEY05 interrupt input 0: Disable 1: Enable
KWUPST05
bit Symbol
(0xFFFF_F365) Read/Write After reset Function
R/W 0 0 1 0 Pull-up Define the KEY05 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY062 0 R/W 0 1 0 Pull-up Define the KEY06 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY072 R/W 0 0 1 0 Pull-up Define the KEY07 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 5 KEY071 4 KEY070 DPE07 5 KEY061 4 KEY060 DPE06
R 0 This can be read as "0."
3
2 R 0
1
0 KEY06EN R/W 0 KEY06 interrupt input 0: Disable 1: Enable
KWUPST06
bit Symbol
(0xFFFF_F366) Read/Write After reset Function
This can be read as "0."
3
2 R
1
0 KEY07EN R/W 0 KEY07 interrupt input 0: Disable 1: Enable
KWUPST07
bit Symbol After reset Function
(0xFFFF_F367) Read/Write
0 This can be read as "0."
TMP19A43(rev2.0)20-8
Key-on Wakeup Circuit
TMP19A43
7 KWUPST08 (0xFFFF_F368) bit Symbol Read/Write After reset Function DPE08
6 KEY082
5 KEY081
4 KEY080
3
2
1
0 KEY08EN R/W 0 KEY08 interrupt input 0: Disable 1: Enable
R/W 0 0 1 0 Pull-up Define the KEY08 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY092 5 KEY091 4 KEY090 DPE09
R 0 This can be read as "0."
3
2
1
0 KEY09EN R/W 0 KEY09 interrupt input 0: Disable 1: Enable
KWUPST09 (0xFFFF_F369)
bit Symbol Read/Write After reset Function
R/W 0 1 0 Pull-up Define the KEY09 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY102 0 R/W 0 1 0 Pull-up Define the KEY10 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY112 R/W 0 0 1 0 Pull-up Define the KEY11 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 5 KEY111 4 KEY110 DPE11 5 KEY101 4 KEY100 DPE10
R 0 This can be read as "0."
3
2 R 0
1
0 KEY10EN R/W 0 KEY10 interrupt input 0: Disable 1: Enable
KWUPST10
bit Symbol
(0xFFFF_F36A) Read/Write After reset Function
This can be read as "0."
3
2 R
1
0 KEY11EN R/W 0 KEY11 interrupt input 0: Disable 1: Enable
KWUPST11
bit Symbol After reset Function
(0xFFFF_F36B) Read/Write
0 This can be read as "0."
TMP19A43(rev2.0)20-9
Key-on Wakeup Circuit
TMP19A43
7 KWUPST12 bit Symbol DPE12 (0xFFFF_F36C) Read/Write After reset Function
6 KEY122
5 KEY121
4 KEY120
3
2
1
0 KEY12EN R/W 0 KEY12 interrupt input 0: Disable 1: Enable
R/W 0 0 1 0 Pull-up Define the KEY12 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY132 5 KEY131 4 KEY130 DPE13
R 0 This can be read as "0."
3
2
1
0 KEY13EN R/W 0 KEY13 interrupt input 0: Disable 1: Enable
KWUPST13
bit Symbol
(0xFFFF_F36D) Read/Write After reset Function
R/W 0 0 1 0 Pull-up Define the KEY13 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY142 R/W 0 1 0 Pull-up Define the KEY14 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY152 R/W 0 0 1 0 Pull-up Define the KEY15 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 5 KEY151 4 KEY150 DPE15 5 KEY141 4 KEY140 DPE14
R 0 This can be read as "0."
3
2 R 0
1
0 KEY14EN R/W 0 KEY14 interrupt input 0: Disable 1: Enable
KWUPST14
bit Symbol
(0xFFFF_F36E) Read/Write After reset Function
This can be read as "0."
3
2 R
1
0 KEY15EN R/W 0 KEY15 interrupt input 0: Disable 1: Enable
KWUPST15 (0xFFFF_F36F)
bit Symbol Read/Write After reset Function
0 This can be read as "0."
TMP19A43(rev2.0)20-10
Key-on Wakeup Circuit
TMP19A43
7 KWUPST16 bit Symbol DPE16 0 (0xFFFF_F370) Read/Write After reset Function
6 KEY162 0 R/W
5 KEY161 1
4 KEY160 0
3
2 R 0
1
0 KEY16EN R/W 0 KEY16 interrupt input 0: Disable 1: Enable
Pull-up Define the KEY16 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY172 5 KEY171 4 KEY170 DPE17
This can be read as "0."
3
2
1
0 KEY17EN R/W 0 KEY17 interrupt input 0: Disable 1: Enable
KWUPST17
bit Symbol
(0xFFFF_F371) Read/Write After reset Function
R/W 0 0 1 0 Pull-up Define the KEY17 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY182 5 KEY181 4 KEY180 DPE18
R 0 This can be read as "0."
3
2
1
0 KEY18EN R/W 0 KEY18 interrupt input 0: Disable 1: Enable
KWUPST18
bit Symbol
(0xFFFF_F372) Read/Write After reset Function
R/W 0 0 1 0 Pull-up Define the KEY18 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY192 5 KEY191 4 KEY190 DPE19
R 0 This can be read as "0."
3
2
1
0 KEY19EN R/W 0 KEY19 interrupt input 0: Disable 1: Enable
KWUPST19
bit Symbol
(0xFFFF_F373) Read/Write After reset Function
R/W 0 1 0 Pull-up Define the KEY19 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges
R 0 This can be read as "0."
TMP19A43(rev2.0)20-11
Key-on Wakeup Circuit
TMP19A43
7 KWUPST20 bit Symbol DPE20 (0xFFFF_F374) Read/Write After reset Function
6 KEY202
5 KEY201
4 KEY200
3
2
1
0 KEY20EN R/W 0 KEY20 interrupt input 0: Disable 1: Enable
R/W 0 0 1 0 Pull-up Define the KEY20 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY212 5 KEY211 4 KEY210 DPE21
R 0 This can be read as "0."
3
2
1
0 KEY21EN R/W 0 KEY21 interrupt input 0: Disable 1: Enable
KWUPST21
bit Symbol
(0xFFFF_F375) Read/Write After reset Function
R/W 0 0 1 0 Pull-up Define the KEY21 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY221 0 R/W 0 1 0 Pull-up Define the KEY22 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY232 R/W 0 0 1 0 Pull-up Define the KEY23 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 5 KEY231 4 KEY230 DPE23 5 KEY221 4 KEY220 DPE22
R 0 This can be read as "0."
3
2 R 0
1
0 KEY22EN R/W 0 KEY22 interrupt input 0: Disable 1: Enable
KWUPST22
bit Symbol
(0xFFFF_F376) Read/Write After reset Function
This can be read as "0."
3
2 R
1
0 KEY23EN R/W 0 KEY23 interrupt input 0: Disable 1: Enable
KWUPST23
bit Symbol After reset Function
(0xFFFF_F377) Read/Write
0 This can be read as "0."
TMP19A43(rev2.0)20-12
Key-on Wakeup Circuit
TMP19A43
7 KWUPST24 bit Symbol DPE24 (0xFFFF_F378) Read/Write After reset Function
6 KEY242
5 KEY241
4 KEY240
3
2
1
0 KEY24EN R/W 0 KEY24 interrupt input 0: Disable 1: Enable
R/W 0 1 0 Pull-up Define the KEY24 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY252 5 KEY251 4 KEY250 DPE25
R 0 This can be read as "0."
3
2
1
0 KEY25EN R/W 0 KEY25 interrupt input 0: Disable 1: Enable
KWUPST25
bit Symbol
(0xFFFF_F379) Read/Write After reset Function
R/W 0 0 1 0 Pull-up Define the KEY25 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY262 0 R/W 0 1 0 Pull-up Define the KEY26 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 KEY272 R/W 0 0 1 0 Pull-up Define the KEY27 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 5 KEY271 4 KEY270 DPE27 5 KEY261 4 KEY260 DPE26
R 0 This can be read as "0."
3
2 R 0
1
0 KEY26EN R/W 0 KEY26 interrupt input 0: Disable 1: Enable
KWUPST26 (0xFFFF_F37A)
bit Symbol Read/Write After reset Function
This can be read as "0."
3
2 R
1
0 KEY27EN R/W 0 KEY27 interrupt input 0: Disable 1: Enable
KWUPST27 (0xFFFF_F37B)
bit Symbol Read/Write After reset Function
0 This can be read as "0."
TMP19A43(rev2.0)20-13
Key-on Wakeup Circuit
TMP19A43
7 KWUPST28 bit Symbol (0xFFFF_F37C) Read/Write After reset Function DPE28
6
5
4
3
2
1
0 KEY28EN R/W 0 KEY28 interrupt input 0: Disable 1: Enable
KEY282 KEY281 KEY280 R/W 0 0 1 0 Pull-up Define the KEY28 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 5 4 KEY290 0 DPE29 0 KEY292 KEY291 R/W 1
R 0 This can be read as "0."
3
2 R 0
1
0 KEY29EN R/W 0 KEY29 interrupt input 0: Disable 1: Enable
KWUPST29 bit Symbol (0xFFFF_F37D) Read/Write After reset Function
Pull-up Define the KEY29 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 5 4 KEY300 0 DPE30 0 KEY302 KEY301 R/W 0 1
This can be read as "0."
3
2 R 0
1
0 KEY30EN R/W 0 KEY30 interrupt input 0: Disable 1: Enable
KWUPST30 bit Symbol (0xFFFF_F37E) Read/Write After reset Function
Pull-up Define the KEY30 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges 7 6 5 4 KEY310 0 DPE31 0 KEY312 KEY311 R/W 0 1
This can be read as "0."
3
2 R 0
1
0 KEY31EN R/W 0 KEY31 interrupt input 0: Disable 1: Enable
KWUPST31 (0xFFFF_F37F)
bit Symbol Read/Write After reset Function
Pull-up Define the KEY31 active state 0:Static 000: "L" level 1:Dynamic 001: "H" level 010: Falling edge 011: Rising edge 100: Both edges
This can be read as "0."
TMP19A43(rev2.0)20-14
Key-on Wakeup Circuit
TMP19A43
20.5 Detection of Key Input Interrupts and Clearance of Requests
When KEYnEN is set to 1 and an active signal is input to KEYn, the KEYINTn channel that corresponds to KWUPINTn is set to "1," indicating that an interrupt is generated. The KWUPINTn is the read-only register. Reading this register clears the corresponding bit that has been set to "1" and the interrupt request. (A clear by KWUPCLR is also possible. If the active state is set to the high or low level, the corresponding bit of the KWUPINTn register remains "1" after it is read, unless the external input is withdrawn.
7 KWUPINT0 (0xFFFF_F388) bit Symbol Read/Write After reset Function KEYINT7 0 :Interrupt
0::Not generated 1:Generated
6 KEYINT6 0 :Interrupt
0::Not generated 1:Generated
5 KEYINT5 0 :Interrupt
0::Not generated 1:Generated
4 KEYINT4 R 0 :Interrupt
0::Not generated 1:Generated
3 KEYINT3 0 :Interrupt
0::Not generated 1:Generated
2 KEYINT2 0 :Interrupt
0::Not generated 1:Generated
1 KEYINT1 0 :Interrupt
0::Not generated 1:Generated
0 KEYINT0 0 :Interrupt
0::Not generated 1:Generated
7 KWUPINT1 (0xFFFF_F389) bit Symbol Read/Write After reset Function
6
5
4
3
2
1 KEYINT9 0 :Interrupt
0::Not generated 1:Generated
0 KEYINT8 0 :Interrupt
0::Not generated 1:Generated
KEYINT15 KEYINT14 KEYINT13 KEYINT12 KEYINT11 KEYINT10 R 0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
7 KWUPINT2 (0xFFFF_F38A) bit Symbol Read/Write After reset Function
6
5
4 R
3
2
1
0 KEYINT16 0 :Interrupt
0::Not generated 1:Generated
KEYINT23 KEYINT22 KEYINT21 KEYINT20 KEYINT19 KEYINT18 KEYINT17 0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
7 KWUPINT3 (0xFFFF_F38B) bit Symbol Read/Write After reset Function
6
5
4
3
2
1
0 KEYINT24 0 :Interrupt
0::Not generated 1:Generated
KEYINT31 KEYINT30 KEYINT29 KEYINT28 KEYINT27 KEYINT26 KEYINT25 R 0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
0 :Interrupt
0::Not generated 1:Generated
7 KWUPCLR (0xFFFF_F385) bit Symbol Read/Write After reset Function
6 R
5
4
3 KEYCLR3
2 KEYCLR2
1 KEYCLR1
0 KEYCLR0
This can be read as "0."
W 0 Writing "1010" clears all the key factors. This can be read as "0."
TMP19A43(rev2.0)20-15
Key-on Wakeup Circuit
TMP19A43
21. ROM Correction Function
This chapter describes the ROM correction function built into the TMP19A43.
21.1 Features
* * Using this function, eight pieces of one-word data or four pieces of eight-word data can be replaced. If an address (lower 5 or 2 bits are "don't care" bits) written to the address register matches an address generated by the PC or DMAC, ROM data is replaced by data generated by the ROM correction data register which is established in a RAM area assigned to the above address register. ROM correction is automatically authorized by writing an address to each address register. If ROM correction cannot be executed using eight-word data due to a program modification or for other reasons, it is possible to place a "jump-to-RAM" instruction in a data register in a RAM area and to correct ROM data in that RAM area.
* *
21.2 Description of Operations
By setting in the address register ADDREGn a physical address (including a projection area) of the ROM area to be corrected, ROM data can be replaced by data generated by a data register in a RAM area assigned to ADDREGn. The ROM correction function is automatically enabled when an address is set in ADDREGn, and it cannot be disabled. After a reset, the ROM correction function is disabled. Therefore, to execute ROM correction with the initialization after a reset is cleared, it is necessary to set an address in ADDREG. As an address is set in ADDREG, the ROM correction function is enabled for this register. If the CPU has the bus authority, ROM data is replaced when the value generated by the PC matches that of the address register. If the DMAC has the bus authority, ROM data is replaced when a source or destination address generated by the DMAC matches the value of the address register. For example, if an address is set in ADDREG0 and ADDREG3, the ROM correction function is enabled for this area; match detection is performed on these registers, and data replacement is executed if there is a match. Data replacement is not executed for ADDREG1, ADDREG2, and ADDREG4 through ADDREG7. Although the bit <31:5> exists in address registers, match detection is performed on A<20:5> for reasons of circuitry simplification. Internal processing is that data replacement is executed when the calculation of a logical product is completed by multiplying the ROMCS signal showing a ROM area by the result of a match detection operation performed by ROM correction circuitry. If eight-word data is replaced, an address for ROM correction can be established only on an eight-word boundary, and data is replaced in units of 32 bytes. If only part of 32-byte data must be replaced with different data, the addresses that do not need to be replaced must be overwritten with the same data as the one existing prior to data replacement. ADDREGn registers and RAM areas assigned to them are as follows:
Register Address 0xFFFF_E540 0xFFFF_E544 0xFFFF_E548 0xFFFF_E54C 0xFFFF_E550 0xFFFF_E554 0xFFFF_E558 0xFFFF_E55C 0xFFFF_E560 0xFFFF_E564 0xFFFF_E568 0xFFFF_E56C RAM area Number of words
ADDREG0 ADDREG1 ADDREG2 ADDREG3 ADDREG4 ADDREG5 ADDREG6 ADDREG7 ADDREG8 ADDREG9 ADDREGA ADDREGB Note:
0xFFFF_DF60 - 0xFFFF_DF7C 0xFFFF_DF80 - 0xFFFF_DF9C 0xFFFF_DFA0 - 0xFFFF_DFBC 0xFFFF_DFC0 - 0xFFFF_DFDC 0xFFFF_DFE0 0xFFFF_DFE4 0xFFFF_DFE8 0xFFFF_DFEC 0xFFFF_DFF0 0xFFFF_DFF4 0xFFFF_DFF8 0xFFFF_DFFC
8 8 8 8 1 1 1 1 1 1 1 1
To use the ROM correction function, the ROM must be unprotected.
TMP19A43(rev2.0)21-1
ROM Correction Function
TMP19A43
Internal bus
Address register ADDREGn
Write detection & hold circuit of ADDREGn
Authorize comparison
Conversion circuit
RAM
ROM
Comparison circuit
Selector
Operand Address
Instruction Address
TX19A processor
Selector
Operand Data
Instruction Data
Bus interface circuit
Fig. 21-1 ROM Correction System Diagram
TMP19A43(rev2.0)21-2
ROM Correction Function
TMP19A43
21.3 Registers
(1) Address registers
7 ADDREG0 (0xFFFF_E540) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD07 0 15 ADD015 0 23 ADD023 0 31 ADD031 0 6 ADD06 R/W 0 14 ADD014 0 22 ADD022 0 30 ADD030 0 5 ADD05 0 13 ADD013 0 21 ADD021 0 29 ADD029 0 1 12 ADD012 0 20 ADD020 0 28 R/W 0 27 0 26 ADD026 0 0 25 ADD025 0 0 24 ADD024 0 R/W 0 19 ADD019 0 18 ADD018 0 17 ADD017 0 16 ADD016 1 11 ADD011 R 1 10 ADD010 1 9 ADD09 1 8 ADD08 4 3 2 1 0
ADD028 ADD027 R/W 0 0
7 ADDREG1 (0xFFFF_E544) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD17 0 15 ADD115 0 23 ADD123 0 31 ADD131 0
6 ADD16 R/W 0 14 ADD114 0 22 ADD122 0 30 ADD130 0
5 ADD15 0 13 ADD113 0 21 ADD121 0 29 ADD129 0
4
3
2 R 1 10 ADD110 0 18 ADD118 0 26 ADD126 0
1
0
1 12
1 11
1 9 ADD19 0 17 ADD117 0 25 ADD125 0
1 8 ADD18 0 16 ADD116 0 24 ADD124 0
ADD112 ADD111 R/W 0 20 ADD120 0 28 ADD128 0 R/W 0 R/W 0 27 ADD127 0 19 ADD119
7 ADDREG2 (0xFFFF_E548) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD27 0 15 ADD215 0 23 ADD223 0 31 ADD231 0
6 ADD26 R/W 0 14 ADD214 0 22 ADD222 0 30 ADD230 0
5 ADD25 0 13 ADD213 0 21 ADD221 0 29 ADD229 0
4
3
2 R 1 10 ADD210 0 18 ADD218 0 26 ADD226 0
1
0
1 12 ADD212 0 20 R/W
1 11 ADD211 0 19
1 9 ADD29 0 17 ADD217 0 25 ADD225 0
1 8 ADD28 0 16 ADD216 0 24 ADD224 0
ADD220 ADD219 R/W 0 28 ADD228 0 R/W 0 0 27 ADD227
TMP19A43(rev2.0)21-3
ROM Correction Function
TMP19A43
7 ADDREG3 (0xFFFF_E54C) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD37 0 15 ADD315 0 23 ADD323 0 31 ADD331 0
6 ADD36 R/W 0 14 ADD314 0 22 ADD322 0 30 ADD330 0
5 ADD35 0 13 ADD313 0 21 ADD321 0 29 ADD329 0
4
3
2 R 1 10 ADD310 0 18 ADD318 0 26 ADD326 0
1
0
1 12
1 11
1 9 ADD39 0 17 ADD317 0 25 ADD325 0
1 8 ADD38 0 16 ADD316 0 24 ADD324 0
ADD312 ADD311 R/W 0 0 20 ADD320 0 28 ADD328 0 R/W 0 R/W 0 27 ADD327 19 ADD319
7 ADDREG4 (0xFFFF_E550) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD47 0 15 ADD415 0 23 ADD423 0 31 ADD431 0 7 ADDREG5 (0xFFFF_E554) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD57 0 15 ADD515 0 23 ADD523 0 31 ADD531 0
6 ADD46 0 14 ADD414 0 22 ADD422 0 30 ADD430 0 6 ADD56 0 14 ADD514 0 22 ADD522 0 30 ADD530 0
5 ADD45 R/W 0 13 ADD413 0 21 ADD421 0 29 ADD429 0 5 ADD55 R/W 0 13 ADD513 0 21 ADD521 0 29 ADD529 0
4 ADD44 0 12 ADD412 0 20 R/W
3 ADD43 0 11 ADD411 0 19
2 ADD42
1 R
0
0 10 ADD410 0 18 ADD418 0 26 ADD426 0 2 ADD52
1 9 ADD49 0 17 ADD417 0 25 ADD425 0 1 R
1 8 ADD48 0 16 ADD416 0 24 ADD424 0 0
ADD420 ADD419 R/W 0 28 ADD428 0 4 ADD54 0 12 R/W 0 3 ADD53 0 11 0 27 ADD427
0 10 ADD510 0 18 ADD518 0 26 ADD526 0
1 9 ADD59 0 17 ADD517 0 25 ADD525 0
1 8 ADD58 0 16 ADD516 0 24 ADD524 0
ADD512 ADD511 R/W 0 20 ADD520 0 28 ADD528 0 R/W 0 R/W 0 27 ADD527 0 19 ADD519
TMP19A43(rev2.0)21-4
ROM Correction Function
TMP19A43
7 ADDREG6 (0xFFFF_E558) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD67 0 15 ADD615 0 23 ADD623 0 31 ADD631 0 7 ADDREG7 (0xFFFF_E55C) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD77 0 15 ADD715 0 23 ADD723 0 31 ADD731 0 7 ADDREG8 (0xFFFF_E560) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD87 0 15 ADD815 0 23 ADD823 0 31 ADD831 0
6 ADD66 0 14 ADD614 0 22 ADD622 0 30 ADD630 0 6 ADD76 0 14 ADD714 0 22 ADD722 0 30 ADD730 0 6 ADD86 0 14 ADD814 0 22 ADD822 0 30 ADD830 0
5 ADD65 R/W 0 13 ADD613 0 21 ADD621 0 29 ADD629 0 5 ADD75 R/W 0 13 ADD713 0 21 ADD721 0 29 ADD729 0 5 ADD85 R/W 0 13 ADD813 0 21 ADD821 0 29 ADD829 0
4 ADD64 0 12
3 ADD63 0 11
2 ADD62
1 R
0
0 10 ADD610 0 18 ADD618 0 26 ADD626 0 2 ADD72
1 9 ADD69 0 17 ADD617 0 25 ADD625 0 1 R
1 8 ADD68 0 16 ADD616 0 24 ADD624 0 0
ADD612 ADD611 R/W 0 0 20 ADD620 0 28 ADD628 0 4 ADD74 0 12 ADD712 0 20 R/W 0 19 R/W 0 3 ADD73 0 11 ADD711 R/W 0 27 ADD627 19 ADD619
0 10 ADD710 0 18 ADD718 0 26 ADD726 0 2 ADD82
1 9 ADD79 0 17 ADD717 0 25 ADD725 0 1 R
1 8 ADD78 0 16 ADD716 0 24 ADD724 0 0
ADD720 ADD719 R/W 0 28 ADD728 0 4 ADD84 0 12 R/W 0 3 ADD83 0 11 0 27 ADD727
0 10 ADD810 0 18 ADD818 0 26 ADD826 0
1 9 ADD89 0 17 ADD817 0 25 ADD825 0
1 8 ADD88 0 16 ADD816 0 24 ADD824 0
ADD812 ADD811 R/W 0 20 ADD820 0 28 ADD828 0 R/W 0 R/W 0 27 ADD827 0 19 ADD819
TMP19A43(rev2.0)21-5
ROM Correction Function
TMP19A43
7 ADDREG9 (0xFFFF_E564) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADD97 0 15 ADD915 0 23 ADD923 0 31 ADD931 0 7 ADDREGA (0xFFFF_E568) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADDA7 0 15 ADDA15 0 23 ADDA23 0 31 ADDA31 0 7 ADDREGB (0xFFFF_E56C) bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset bit Symbol Read/Write After reset ADDB7 0 15 ADDB15 0 23 ADDB23 0 31 ADDB31 0
6 ADD96 0 14 ADD914 0 22 ADD922 0 30 ADD930 0 6 ADDA6 0 14 ADDA14 0 22 ADDA22 0 30 ADDA30 0 6 ADDB6 0 14 ADDB14 0 22 ADDB22 0 30 ADDB30 0
5 ADD95 R/W 0 13 ADD913 0 21 ADD921 0 29 ADD929 0 5
4 ADD94 0 12
3 ADD93 0 11
2 ADD92
1 R
0
0 10 ADD910 0 18 ADD918 0 26 ADD926 0 2 ADDA2
1 9 ADD99 0 17 ADD917 0 25 ADD925 0 1 R
1 8 ADD98 0 16 ADD916 0 24 ADD924 0 0
ADD912 ADD911 R/W 0 0 20 ADD920 0 28 ADD928 0 4 R/W 0 3 ADDA3 0 11 ADDA11 0 19 R/W R/W 0 27 ADD927 19 ADD919
ADDA5 ADDA4 R/W 0 0 13 ADDA13 0 21 ADDA21 0 29 ADDA29 0 5 ADDB5 R/W 0 13 ADDB13 0 21 ADDB21 0 29 ADDB29 0 0 12 12 ADDA12 0 20
0 10 ADDA10 0 18 ADDA18 0 26 ADDA26 0 2 ADDB2
1 9 ADDA9 0 17 ADDA17 0 25 ADDA25 0 1 R
1 8 ADDA8 0 16 ADDA16 0 24 ADDA24 0 0
ADDA20 ADDA19 R/W 0 28 ADDA28 0 4 ADDB4 R/W 0 3 ADDB3 0 11 0 27 ADDA27
0 10 ADDB10 0 18 ADDB18 0 26 ADDB26 0
1 9 ADDB9 0 17 ADDB17 0 25 ADDB25 0
1 8 ADDB8 0 16 ADDB16 0 24 ADDB24 0
ADDB12 ADDB11 R/W 0 20 ADDB20 0 28 ADDB28 0 R/W 0 R/W 0 27 ADDB27 0 19 ADDB19
(Note 1) Data cannot be transferred by DMA to the address register. However, data can be transferred by DMA to the RAM area where data for replacement is placed. The ROM correction function supports data replacement for both CPU and DMA access. (Note 2) Writing back the initial value "0x00" allows data at the reset address to be replaced.
TMP19A43(rev2.0)21-6
ROM Correction Function
TMP19A43
22. Table of Special Function Registers
Special function registers are allocated to an 8K-byte address space from FFFFE000H to FFFFFFFFH. [1] Port registers [2] Watchdog timer [3] 16-bit timer [4] I2CBUS/serial channel [5] UART/serial channel [6] 10-bit A/D converter [7] 8-bit D/A converter [8] Key-on wake-up [9] 32-bit input capture [10] 32-bit compare [11] Interrupt controller [12] DMA controller [13] Chip select/wait controller [14] FLASH control [15] ROM correction [16] Clock timer [17] UART/high-speed serial channel [18] Clock generator
(Note)
0xFFFF_F000 to 0xFFFF_FFFF are a little-endian area. 0xFFFF_E000 to 0xFFFF_EFFF are a bi-endian area. For continuous 8-bit long registers, 16- or 32-bit access is possible. The use of 16- or 32-bit access requires that an even-number address be accessed and that an even-number address does not contain undefined areas.
(Note)
TMP19A43(rev2.0)22-1
Table of Special Function Registers
TMP19A43
Big-endian
[1] PORT registers
ADR
FFFFF000H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
P0 P1 P0CR P1CR P1FC
ADR
FFFFF010H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF020H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
P4CR P4FC
ADR
FFFFF030H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
P6ODE P9ODE
P2 P2CR P2FC P2FC2 P3 P3CR P3FC P2PE P3PE P4
P4PE P5PE P6PE P5 P6
PBODE PCODE PDODE
P0PE P1PE
P5CR P5FC P6CR P6FC
P5FC2 P6FC2 reserved reserved
ADR
FFFFF040H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
P7 P8 P9 PA - - P9CR PACR P7FC P8FC P9FC PAFC P7PE P8PE P9PE PAPE
ADR
FFFFF050H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
PB PC PD PE PBCR PCCR PDCR PECR PBFC PCFC PDFC PEFC PBPE PCPE PDPE PEPE
ADR
FFFFF060H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
PF PG PH PFCR PGCR PHCR PFFC PGFC - - PFPE PGPE PHPE
ADR
FFFFF070H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0D0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0E0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0F0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TMP19A43(rev2.0)22-2
Table of Special Function Registers
TMP19A43
Big-endian
[2] WDT
ADR
FFFFF080H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
Register name
ADR
FFFFF0A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
FFFFF090H WDMOD 1H WDCR 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[3] 16-bit timer
ADR
FFFFF1 40H 1H 2H 3H
Register name
TB0RUN TB0CR TB0MOD TB0FFCR
ADR
FFFFF150H 1H 2H 3H
Register name
TB1RUN TB1CR TB1MOD TB1FFCR
ADR
FFFFF160H 1H 2H 3H
Register name
TB2RUN TB2CR TB2MOD TB2FFCR
ADR
FFFFF170H 1H 2H 3H
Register name
TB3RUN TB3CR TB3MOD TB3FFCR
4H TB0ST 5H 6H TB0UCL 7H TB0UCH 8H 9H AH BH CH DH EH FH TB0RG0L TB0RG0H TB0RG1L TB0RG1H TB0CP0L TB0CP0H TB0CP1L TB0CP1H
4H TB1ST 5H 6H TB1UCL 7H TB1UCH 8H 9H AH BH CH DH EH FH TB1RG0L TB1RG0H TB1RG1L TB1RG1H TB1CP0L TB1CP0H TB1CP1L TB1CP1H
4H TB2ST 5H 6H TB2UCL 7H TB2UCH 8H 9H AH BH CH DH EH FH TB2RG0L TB2RG0H TB2RG1L TB2RG1H TB2CP0L TB2CP0H TB2CP1L TB2CP1H
4H TB3ST 5H 6H TB3UCL 7H TB3UCH 8H 9H AH BH CH DH EH FH TB3RG0L TB3RG0H TB3RG1L TB3RG1H TB3CP0L TB3CP0H TB3CP1L TB3CP1H
ADR
FFFFF180H 1H 2H 3H
Register name
TB4RUN TB4CR TB4MOD TB4FFCR
ADR
FFFFF190H 1H 2H 3H
Register name
TB5RUN TB5CR TB5MOD TB5FFCR
ADR
FFFFF1A0H 1H 2H 3H
Register name
TB6RUN TB6CR TB6MOD TB6FFCR
ADR
FFFFF1B0H 1H 2H 3H
Register name
TB7RUN TB7CR TB7MOD TB7FFCR
4H TB4ST 5H 6H TB4UCL 7H TB4UCH 8H 9H AH BH CH DH EH FH TB4RG0L TB4RG0H TB4RG1L TB4RG1H TB4CP0L TB4CP0H TB4CP1L TB4CP1H
4H TB5ST 5H 6H TB5UCL 7H TB5UCH 8H 9H AH BH CH DH EH FH TB5RG0L TB5RG0H TB5RG1L TB5RG1H TB5CP0L TB5CP0H TB5CP1L TB5CP1H
4H TB6ST 5H 6H TB6UCL 7H TB6UCH 8H 9H AH BH CH DH EH FH TB6RG0L TB6RG0H TB6RG1L TB6RG1H TB6CP0L TB6CP0H TB6CP1L TB6CP1H
4H TB7ST 5H 6H TB7UCL 7H TB7UCH 8H 9H AH BH CH DH EH FH TB7RG0L TB7RG0H TB7RG1L TB7RG1H TB7CP0L TB7CP0H TB7CP1L TB7CP1H
TMP19A43(rev2.0)22-3
Table of Special Function Registers
TMP19A43
Big-endian
ADR
FFFFF1C0H 1H 2H 3H
Register name
TB8RUN TB8CR TB8MOD TB8FFCR
ADR
FFFFF1D0H 1H 2H 3H
Register name
TB9RUN TB9CR TB9MOD TB9FFCR
ADR
FFFFF1E0H 1H 2H 3H
Register name
TBARUN TBACR TBAMOD TBAFFCR
ADR
FFFFF1F0H 1H 2H 3H
Register name
TBBRUN TBBCR TBBMOD TBBFFCR
4H TB8ST 5H 6H TB8UCL 7H TB8UCH 8H 9H AH BH CH DH EH FH TB8RG0L TB8RG0H TB8RG1L TB8RG1H TB8CP0L TB8CP0H TB8CP1L TB8CP1H
4H TB9ST 5H 6H TB9UCL 7H TB9UCH 8H 9H AH BH CH DH EH FH TB9RG0L TB9RG0H TB9RG1L TB9RG1H TB9CP0L TB9CP0H TB9CP1L TB9CP1H
4H TBAST 5H 6H TBAUCL 7H TBAUCH 8H 9H AH BH CH DH EH FH TBARG0L TBARG0H TBARG1L TBARG1H TBACP0L TBACP0H TBACP1L TBACP1H
4H TBBST 5H 6H TBBUCL 7H TBBUCH 8H 9H AH BH CH DH EH FH TBBRG0L TBBRG0H TBBRG1L TBBRG1H TBBCP0L TBBCP0H TBBCP1L TBBCP1H
ADR
FFFFF200H 1H 2H 3H
Register name
TBCRUN TBCCR TBCMOD TBCFFCR
ADR
FFFFF210H 1H 2H 3H
Register name
TBDRUN TBDCR TBDMOD TBDFFCR
ADR
FFFFF220H 1H 2H 3H
Register name
TBERUN TBECR TBEMOD TBEFFCR
ADR
FFFFF230H 1H 2H 3H
Register name
TBFRUN TBFCR TBFMOD TBFFFCR
4H TBCST 5H 6H TBCUCL 7H TBCUCH 8H 9H AH BH CH DH EH FH TBCRG0L TBCRG0H TBCRG1L TBCRG1H TBCCP0L TBCCP0H TBCCP1L TBCCP1H
4H TBDST 5H 6H TBDUCL 7H TBDUCH 8H 9H AH BH CH DH EH FH TBDRG0L TBDRG0H TBDRG1L TBDRG1H TBDCP0L TBDCP0H TBDCP1L TBDCP1H
4H TBEST 5H 6H TBEUCL 7H TBEUCH 8H 9H AH BH CH DH EH FH TBERG0L TBERG0H TBERG1L TBERG1H TBECP0L TBECP0H TBECP1L TBECP1H
4H TBFST 5H 6H TBFUCL 7H TBFUCH 8H 9H AH BH CH DH EH FH TBFRG0L TBFRG0H TBFRG1L TBFRG1H TBFCP0L TBFCP0H TBFCP1L TBFCP1H
TMP19A43(rev2.0)22-4
Table of Special Function Registers
TMP19A43
Big-endian
[4] I2C/SIO
ADR
FFFFF250H 1H 2H 3H
[5] UART/SIO
Register name
SBICR1 SBIDBR I2CAR SBICR2/SR
ADR
FFFFF260H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH
Register name
SC0BUF SC0CR SC0MOD0 BR0CR BR0ADD SC0MOD1 SC0MOD2 SC0EN SC0RFC SC0TFC SC0RST SC0TST
ADR
FFFFF270H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH
Register name
SC1BUF SC1CR SC1MOD0 BR1CR BR1ADD SC1MOD1 SC1MOD2 SC1EN SC1RFC SC1TFC SC1RST SC1TST
ADR
FFFFF280H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH
Register name
SC2BUF SC2CR SC2MOD0 BR2CR BR2ADD SC2MOD1 SC2MOD2 SC2EN SC2RFC SC2TFC SC2RST SC2TST
4H SBIBR0 5H 6H 7H SBICR0 8H 9H AH BH CH DH EH FH
CH SC0FCNF DH EH FH
CH SC1FCNF DH EH FH
CH SC2FCNF DH EH FH
ADR
FFFFF290H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF2A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF2B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF2C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
[6] 10-bit ADC
ADR
FFFFF300H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[7] 8-bit DAC
Register name ADR
FFFFF310H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADREGSPL ADREGSPH
ADCOMREGL ADCOMREGH
ADR
FFFFF330H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
DACCNT0 DAREG0
ADR
FFFFF340H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADREG08L ADREG08H ADREG19L ADREG19H ADREG2AL ADREG2AH ADREG3BL ADREG3BH ADREG4CL ADREG4CH ADREG5DL ADREG5DH ADREG6EL ADREG6EH ADREG7FL ADREG7FH
ADMOD0 ADMOD1 ADMOD2 ADMOD3 ADMOD4 ADCBAS Reserved Reserved ADCLK
Reserved DACCNT1 DAREG1
Reserved
TMP19A43(rev2.0)22-5
Table of Special Function Registers
TMP19A43
Big-endian
[8] KWUP
ADR
FFFFF360H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
KWUPST00 KWUPST01 KWUPST02 KWUPST03 KWUPST04 KWUPST05 KWUPST06 KWUPST07 KWUPST08 KWUPST09 KWUPST10 KWUPST11 KWUPST12 KWUPST13 KWUPST14 KWUPST15
ADR
FFFFF370H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
KWUPST16 KWUPST17 KWUPST18 KWUPST19 KWUPST20 KWUPST21 KWUPST22 KWUPST23 KWUPST24 KWUPST25 KWUPST26 KWUPST27 KWUPST28 KWUPST29 KWUPST30 KWUPST31
ADR
FFFFF380H 1H 2H 3H
Register name
PKEY0 PKEY1 PKEY2 PKEY3
ADR
FFFFF390H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
4H KWUPCNT 5H KWUPCLR 6H 7H 8H 9H AH BH CH DH EH FH KWUPINT0 KWUPINT1 KWUPINT2 KWUPINT3
[9] 32-bit input capture
ADR Register name ADR Register name ADR Register name ADR
FFFFF430H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
FFFFF 400H TCCR 1H TBTRUN 2H TBTCR 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH TBTCAP0 TBTCAP1 TBTCAP2 TBTCAP3
TBTRDCAPLL TBTRDCAPLH TBTRDCAPHL TBTRDCAPHH
FFFFF410H CAP0CR 1H 2H 3H 4H 5H 6H 7H TCCAP0LL TCCAP0LH TCCAP0HL TCCAP0HH
FFFFF420H CAP2CR 1H 2H 3H 4H 5H 6H 7H TCCAP2LL TCCAP2LH TCCAP2HL TCCAP2HH
8H CAP1CR 9H AH BH CH DH EH FH TCCAP1LL TCCAP1LH TCCAP1HL TCCAP1HH
8H CAP3CR 9H AH BH CH DH EH FH TCCAP3LL TCCAP3LH TCCAP3HL TCCAP3HH
TCG0IM TCG0ST Reserved Reserved
[10] 32-bit output compare
ADR
FFFFF 440H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TCCMP0LL TCCMP0LH TCCMP0HL TCCMP0HH TCCMP1LL TCCMP1LH TCCMP1HL TCCMP1HH TCCMP2LL TCCMP2LH TCCMP2HL TCCMP2HH TCCMP3LL TCCMP3LH TCCMP3HL TCCMP3HH
ADR
FFFFF450H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TCCMP4LL TCCMP4LH TCCMP4HL TCCMP4HH TCCMP5LL TCCMP5LH TCCMP5HL TCCMP5HH TCCMP6LL TCCMP6LH TCCMP6HL TCCMP6HH TCCMP7LL TCCMP7LH TCCMP7HL TCCMP7HH
ADR
FFFFF460H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF470H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CMPCTL0 CMPCTL1 CMPCTL2 CMPCTL3 CMPCTL4 CMPCTL5 CMPCTL6 CMPCTL7
TMP19A43(rev2.0)22-6
Table of Special Function Registers
TMP19A43
Big-endian
[11] INTC
ADR
FFFFE000H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMC0 ditto ditto ditto IMC1 ditto ditto ditto IMC2 ditto ditto ditto IMC3 ditto ditto ditto
ADR
FFFFE010H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMC4 ditto ditto ditto IMC5 ditto ditto ditto IMC6 ditto ditto ditto IMC7 ditto ditto ditto
ADR
FFFFE020H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMC8 ditto ditto ditto IMC9 ditto ditto ditto IMCA ditto ditto ditto IMCB ditto ditto ditto
ADR
FFFFE030H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMCC ditto ditto ditto IMCD ditto ditto ditto IMCE ditto ditto ditto IMCF ditto ditto ditto
ADR
FFFFE040H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IVR ditto ditto ditto
ADR
FFFFE050H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE060H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
INTCLR ditto ditto ditto
ADR
FFFFE070H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE100H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ILEV ditto ditto ditto
TMP19A43(rev2.0)22-7
Table of Special Function Registers
TMP19A43
Big-endian
[12] DMAC
ADR
FFFFE200H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR0 ditto ditto ditto CSR0 ditto ditto ditto SAR0 ditto ditto ditto DAR0 ditto ditto ditto
ADR
FFFFE210H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR0 ditto ditto ditto
ADR
FFFFE220H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR1 ditto ditto ditto CSR1 ditto ditto ditto SAR1 ditto ditto ditto DAR1 ditto ditto ditto
ADR
FFFFE230H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR1 ditto ditto ditto
DTCR0 ditto ditto ditto
DTCR1 ditto ditto ditto
ADR
FFFFE240H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR2 ditto ditto ditto CSR2 ditto ditto ditto SAR2 ditto ditto ditto DAR2 ditto ditto ditto
ADR
FFFFE250H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR2 ditto ditto ditto
ADR
FFFFE260H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR3 ditto ditto ditto CSR3 ditto ditto ditto SAR3 ditto ditto ditto DAR3 ditto ditto ditto
ADR
FFFFE270H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR3 ditto ditto ditto
DTCR2 ditto ditto ditto
DTCR3 ditto ditto ditto
ADR
FFFFE280H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR4 ditto ditto ditto CSR4 ditto ditto ditto SAR4 ditto ditto ditto DAR4 ditto ditto ditto
ADR
FFFFE290H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR4 ditto ditto ditto
ADR
FFFFE2A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR5 ditto ditto ditto CSR5 ditto ditto ditto SAR5 ditto ditto ditto DAR5 ditto ditto ditto
ADR
FFFFE2B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR5 ditto ditto ditto
DTCR4 ditto ditto ditto
DTCR5 ditto ditto ditto
TMP19A43(rev2.0)22-8
Table of Special Function Registers
TMP19A43
Big-endian
ADR
FFFFE2C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR6 ditto ditto ditto CSR6 ditto ditto ditto SAR6 ditto ditto ditto DAR6 ditto ditto ditto
ADR
FFFFE2D0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR6 ditto ditto ditto
ADR
FFFFE2E0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR7 ditto ditto ditto CSR7 ditto ditto ditto SAR7 ditto ditto ditto DAR7 ditto ditto ditto
ADR
FFFFE2F0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR7 ditto ditto ditto
DTCR6 ditto ditto ditto
DTCR7 ditto ditto ditto
ADR
FFFFE300H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
DCR ditto ditto ditto RSR ditto ditto ditto
ADR
FFFFE310H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE320H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE330H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
DHR ditto ditto ditto
ADR
FFFFE340H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE350H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE360H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE370H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TMP19A43(rev2.0)22-9
Table of Special Function Registers
TMP19A43
Big-endian
[13] CS/WAIT controller
ADR
FFFFE400H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BMA0 ditto ditto ditto BMA1 ditto ditto ditto BMA2 ditto ditto ditto BMA3 ditto ditto ditto
ADR
FFFFE410H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE480H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
B01CS ditto ditto ditto B23CS ditto ditto ditto
ADR
FFFFE490H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BEXCS ditto
[14] FLASH control
ADR
FFFFE510H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
SEQMOD ditto ditto ditto SEQCNT ditto ditto ditto ROMSEC1 ditto ditto ditto ROMSEC2 ditto ditto ditto
ADR
FFFFE520H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
FLCS ditto ditto ditto Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved
ADR
FFFFE620H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name Attention
Reserved Reserved Reserved Reserved
[15] ROM correction
ADR
FFFFE540H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADDREG0 ditto ditto ditto ADDREG1 ditto ditto ditto ADDREG2 ditto ditto ditto ADDREG3 ditto ditto ditto
ADR
FFFFE550H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADDREG4 ditto ditto ditto ADDREG5 ditto ditto ditto ADDREG6 ditto ditto ditto ADDREG7 ditto ditto ditto
ADR
FFFFE560H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADDREG8 ditto ditto ditto ADDREG9 ditto ditto ditto ADDREGA ditto ditto ditto ADDREGB ditto ditto ditto
ADR
FFFFE570H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TMP19A43(rev2.0)22-10 Table of Special Function Registers
TMP19A43
Big-endian
[16] Clock timer
ADR
FFFFE700H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE710H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
RTCCR ditto ditto ditto RTCREG ditto ditto ditto
[17] UART/HSIO
ADR Register name ADR Register name ADR Register name ADR
FFFFE840H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
FFFFE800H 1H 2H 3H HSC0BUF 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH HSC0EN HSC0MOD2 HSC0MOD1 HBR0ADD HSC0TST HSC0RST HSC0TFC HSC0RFC HBR0CR HSC0MOD0 HSC0CR HSC0FCNF
FFFFE810H 1H 2H 3H HSC1BUF 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH HSC1EN HSC1MOD2 HSC1MOD1 HBR1ADD HSC1TST HSC1RST HSC1TFC HSC1RFC HBR1CR HSC1MOD0 HSC1CR HSC1FCNF
FFFFE820H 1H 2H 3H HSC2BUF 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH HSC2EN HSC2MOD2 HSC2MOD1 HBR2ADD HSC2TST HSC2RST HSC2TFC HSC2RFC HBR2CR HSC2MOD0 HSC2CR HSC2FCNF
[18] CG
ADR
FFFFEE00H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
SYSCR3 SYSCR2 SYSCR1 SYSCR0
ADR
FFFFEE10H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMCGA ditto ditto ditto IMCGB ditto ditto ditto IMCGC ditto ditto ditto IMCGD ditto ditto ditto
ADR
FFFFEE20H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
EICRCG ditto ditto ditto NMIFLG ditto ditto ditto
ADR
FFFFEE40H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TMP19A43(rev2.0)22-11 Table of Special Function Registers
TMP19A43
Little-endian
[1] PORT registers
ADR
FFFFF000H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
P0 P1 P0CR P1CR P1FC
ADR
FFFFF010H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF020H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
P4CR P4FC
ADR
FFFFF030H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
P6ODE P9ODE
P2 P2CR P2FC P2FC2 P3 P3CR P3FC P2PE P3PE P4
P4PE P5PE P6PE P5 P6
PBODE PCODE PDODE
P0PE P1PE
P5CR P5FC P6CR P6FC
P5FC2 P6FC2 reserved reserved
ADR
FFFFF040H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
P7 P8 P9 PA - - P9CR PACR P7FC P8FC P9FC PAFC P7PE P8PE P9PE PAPE
ADR
FFFFF050H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
PB PC PD PE PBCR PCCR PDCR PECR PBFC PCFC PDFC PEFC PBPE PCPE PDPE PEPE
ADR
FFFFF060H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
PF PG PH PFCR PGCR PHCR PFFC PGFC - - PFPE PGPE PHPE
ADR
FFFFF070H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0D0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0E0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0F0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TMP19A43(rev2.0)22-12 Table of Special Function Registers
TMP19A43
Little-endian
[2] WDT
ADR
FFFFF080H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
Register name
ADR
FFFFF0A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF0B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
FFFFF090H WDMOD 1H WDCR 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[3] 16-bit timer
ADR
FFFFF1 40H 1H 2H 3H
Register name
TB0RUN TB0CR TB0MOD TB0FFCR
ADR
FFFFF150H 1H 2H 3H
Register name
TB1RUN TB1CR TB1MOD TB1FFCR
ADR
FFFFF160H 1H 2H 3H
Register name
TB2RUN TB2CR TB2MOD TB2FFCR
ADR
FFFFF170H 1H 2H 3H
Register name
TB3RUN TB3CR TB3MOD TB3FFCR
4H TB0ST 5H 6H TB0UCL 7H TB0UCH 8H 9H AH BH CH DH EH FH TB0RG0L TB0RG0H TB0RG1L TB0RG1H TB0CP0L TB0CP0H TB0CP1L TB0CP1H
4H TB1ST 5H 6H TB1UCL 7H TB1UCH 8H 9H AH BH CH DH EH FH TB1RG0L TB1RG0H TB1RG1L TB1RG1H TB1CP0L TB1CP0H TB1CP1L TB1CP1H
4H TB2ST 5H 6H TB2UCL 7H TB2UCH 8H 9H AH BH CH DH EH FH TB2RG0L TB2RG0H TB2RG1L TB2RG1H TB2CP0L TB2CP0H TB2CP1L TB2CP1H
4H TB3ST 5H 6H TB3UCL 7H TB3UCH 8H 9H AH BH CH DH EH FH TB3RG0L TB3RG0H TB3RG1L TB3RG1H TB3CP0L TB3CP0H TB3CP1L TB3CP1H
ADR
FFFFF180H 1H 2H 3H
Register name
TB4RUN TB4CR TB4MOD TB4FFCR
ADR
FFFFF190H 1H 2H 3H
Register name
TB5RUN TB5CR TB5MOD TB5FFCR
ADR
FFFFF1A0H 1H 2H 3H
Register name
TB6RUN TB6CR TB6MOD TB6FFCR
ADR
FFFFF1B0H 1H 2H 3H
Register name
TB7RUN TB7CR TB7MOD TB7FFCR
4H TB4ST 5H 6H TB4UCL 7H TB4UCH 8H 9H AH BH CH DH EH FH TB4RG0L TB4RG0H TB4RG1L TB4RG1H TB4CP0L TB4CP0H TB4CP1L TB4CP1H
4H TB5ST 5H 6H TB5UCL 7H TB5UCH 8H 9H AH BH CH DH EH FH TB5RG0L TB5RG0H TB5RG1L TB5RG1H TB5CP0L TB5CP0H TB5CP1L TB5CP1H
4H TB6ST 5H 6H TB6UCL 7H TB6UCH 8H 9H AH BH CH DH EH FH TB6RG0L TB6RG0H TB6RG1L TB6RG1H TB6CP0L TB6CP0H TB6CP1L TB6CP1H
4H TB7ST 5H 6H TB7UCL 7H TB7UCH 8H 9H AH BH CH DH EH FH TB7RG0L TB7RG0H TB7RG1L TB7RG1H TB7CP0L TB7CP0H TB7CP1L TB7CP1H
TMP19A43(rev2.0)22-13 Table of Special Function Registers
TMP19A43
Little-endian
ADR
FFFFF1C0H 1H 2H 3H
Register name
TB8RUN TB8CR TB8MOD TB8FFCR
ADR
FFFFF1D0H 1H 2H 3H
Register name
TB9RUN TB9CR TB9MOD TB9FFCR
ADR
FFFFF1E0H 1H 2H 3H
Register name
TBARUN TBACR TBAMOD TBAFFCR
ADR
FFFFF1F0H 1H 2H 3H
Register name
TBBRUN TBBCR TBBMOD TBBFFCR
4H TB8ST 5H 6H TB8UCL 7H TB8UCH 8H 9H AH BH CH DH EH FH TB8RG0L TB8RG0H TB8RG1L TB8RG1H TB8CP0L TB8CP0H TB8CP1L TB8CP1H
4H TB9ST 5H 6H TB9UCL 7H TB9UCH 8H 9H AH BH CH DH EH FH TB9RG0L TB9RG0H TB9RG1L TB9RG1H TB9CP0L TB9CP0H TB9CP1L TB9CP1H
4H TBAST 5H 6H TBAUCL 7H TBAUCH 8H 9H AH BH CH DH EH FH TBARG0L TBARG0H TBARG1L TBARG1H TBACP0L TBACP0H TBACP1L TBACP1H
4H TBBST 5H 6H TBBUCL 7H TBBUCH 8H 9H AH BH CH DH EH FH TBBRG0L TBBRG0H TBBRG1L TBBRG1H TBBCP0L TBBCP0H TBBCP1L TBBCP1H
ADR
FFFFF200H 1H 2H 3H
Register name
TBCRUN TBCCR TBCMOD TBCFFCR
ADR
FFFFF210H 1H 2H 3H
Register name
TBDRUN TBDCR TBDMOD TBDFFCR
ADR
FFFFF220H 1H 2H 3H
Register name
TBERUN TBECR TBEMOD TBEFFCR
ADR
FFFFF230H 1H 2H 3H
Register name
TBFRUN TBFCR TBFMOD TBFFFCR
4H TBCST 5H 6H TBCUCL 7H TBCUCH 8H 9H AH BH CH DH EH FH TBCRG0L TBCRG0H TBCRG1L TBCRG1H TBCCP0L TBCCP0H TBCCP1L TBCCP1H
4H TBDST 5H 6H TBDUCL 7H TBDUCH 8H 9H AH BH CH DH EH FH TBDRG0L TBDRG0H TBDRG1L TBDRG1H TBDCP0L TBDCP0H TBDCP1L TBDCP1H
4H TBEST 5H 6H TBEUCL 7H TBEUCH 8H 9H AH BH CH DH EH FH TBERG0L TBERG0H TBERG1L TBERG1H TBECP0L TBECP0H TBECP1L TBECP1H
4H TBFST 5H 6H TBFUCL 7H TBFUCH 8H 9H AH BH CH DH EH FH TBFRG0L TBFRG0H TBFRG1L TBFRG1H TBFCP0L TBFCP0H TBFCP1L TBFCP1H
TMP19A43(rev2.0)22-14 Table of Special Function Registers
TMP19A43
Little-endian
[4] I2C/SIO
ADR
FFFFF250H 1H 2H 3H
[5] UART/SIO
Register name
SBICR1 SBIDBR I2CAR SBICR2/SR
ADR
FFFFF260H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH
Register name
SC0BUF SC0CR SC0MOD0 BR0CR BR0ADD SC0MOD1 SC0MOD2 SC0EN SC0RFC SC0TFC SC0RST SC0TST
ADR
FFFFF270H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH
Register name
SC1BUF SC1CR SC1MOD0 BR1CR BR1ADD SC1MOD1 SC1MOD2 SC1EN SC1RFC SC1TFC SC1RST SC1TST
ADR
FFFFF280H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH
Register name
SC2BUF SC2CR SC2MOD0 BR2CR BR2ADD SC2MOD1 SC2MOD2 SC2EN SC2RFC SC2TFC SC2RST SC2TST
4H SBIBR0 5H 6H 7H SBICR0 8H 9H AH BH CH DH EH FH
CH SC0FCNF DH EH FH
CH SC1FCNF DH EH FH
CH SC2FCNF DH EH FH
ADR
FFFFF290H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF2A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF2B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF2C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
[6] 10-bit ADC
ADR
FFFFF300H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
[7] 8-bit ADC
Register name ADR
FFFFF310H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADREGSPL ADREGSPH
ADCOMREGL ADCOMREGH
ADR
FFFFF330H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
DACCNT0 DAREG0
ADR
FFFFF340H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADREG08L ADREG08H ADREG19L ADREG19H ADREG2AL ADREG2AH ADREG3BL ADREG3BH ADREG4CL ADREG4CH ADREG5DL ADREG5DH ADREG6EL ADREG6EH ADREG7FL ADREG7FH
ADMOD0 ADMOD1 ADMOD2 ADMOD3 ADMOD4 ADCBAS Reserved Reserved ADCLK
Reserved DACCNT1 DAREG1
Reserved
TMP19A43(rev2.0)22-15 Table of Special Function Registers
TMP19A43
Little-endian
[8] KWUP
ADR
FFFFF360H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
KWUPST00 KWUPST01 KWUPST02 KWUPST03 KWUPST04 KWUPST05 KWUPST06 KWUPST07 KWUPST08 KWUPST09 KWUPST10 KWUPST11 KWUPST12 KWUPST13 KWUPST14 KWUPST15
ADR
FFFFF370H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
KWUPST16 KWUPST17 KWUPST18 KWUPST19 KWUPST20 KWUPST21 KWUPST22 KWUPST23 KWUPST24 KWUPST25 KWUPST26 KWUPST27 KWUPST28 KWUPST29 KWUPST30 KWUPST31
ADR
FFFFF380H 1H 2H 3H
Register name
PKEY0 PKEY1 PKEY2 PKEY3
ADR
FFFFF390H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
4H KWUPCNT 5H KWUPCLR 6H 7H 8H 9H AH BH CH DH EH FH KWUPINT0 KWUPINT1 KWUPINT2 KWUPINT3
[9] 32-bit input capture
ADR Register name ADR Register name ADR Register name ADR
FFFFF430H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
FFFFF 400H TCCR 1H TBTRUN 2H TBTCR 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH TBTCAP0 TBTCAP1 TBTCAP2 TBTCAP3
TBTRDCAPLL TBTRDCAPLH TBTRDCAPHL TBTRDCAPHH
FFFFF410H CAP0CR 1H 2H 3H 4H 5H 6H 7H TCCAP0LL TCCAP0LH TCCAP0HL TCCAP0HH
FFFFF420H CAP2CR 1H 2H 3H 4H 5H 6H 7H TCCAP2LL TCCAP2LH TCCAP2HL TCCAP2HH
8H CAP1CR 9H AH BH CH DH EH FH TCCAP1LL TCCAP1LH TCCAP1HL TCCAP1HH
8H CAP3CR 9H AH BH CH DH EH FH TCCAP3LL TCCAP3LH TCCAP3HL TCCAP3HH
TCG0IM TCG0ST Reserved Reserved
[10] 32-bit output compare
ADR
FFFFF 440H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TCCMP0LL TCCMP0LH TCCMP0HL TCCMP0HH TCCMP1LL TCCMP1LH TCCMP1HL TCCMP1HH TCCMP2LL TCCMP2LH TCCMP2HL TCCMP2HH TCCMP3LL TCCMP3LH TCCMP3HL TCCMP3HH
ADR
FFFFF450H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TCCMP4LL TCCMP4LH TCCMP4HL TCCMP4HH TCCMP5LL TCCMP5LH TCCMP5HL TCCMP5HH TCCMP6LL TCCMP6LH TCCMP6HL TCCMP6HH TCCMP7LL TCCMP7LH TCCMP7HL TCCMP7HH
ADR
FFFFF460H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFF470H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CMPCTL0 CMPCTL1 CMPCTL2 CMPCTL3 CMPCTL4 CMPCTL5 CMPCTL6 CMPCTL7
TMP19A43(rev2.0)22-16 Table of Special Function Registers
TMP19A43
Little-endian
[11] INTC
ADR
FFFFE000H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMC0 ditto ditto ditto IMC1 ditto ditto ditto IMC2 ditto ditto ditto IMC3 ditto ditto ditto
ADR
FFFFE010H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMC4 ditto ditto ditto IMC5 ditto ditto ditto IMC6 ditto ditto ditto IMC7 ditto ditto ditto
ADR
FFFFE020H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMC8 ditto ditto ditto IMC9 ditto ditto ditto IMCA ditto ditto ditto IMCB ditto ditto ditto
ADR
FFFFE030H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMCC ditto ditto ditto IMCD ditto ditto ditto IMCE ditto ditto ditto IMCF ditto ditto ditto
ADR
FFFFE040H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IVR ditto ditto ditto
ADR
FFFFE050H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE060H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
INTCLR ditto ditto ditto
ADR
FFFFE070H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE100H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ILEV ditto ditto ditto
TMP19A43(rev2.0)22-17 Table of Special Function Registers
TMP19A43
Little-endian
[12] DMAC
ADR
FFFFE200H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR0 ditto ditto ditto CSR0 ditto ditto ditto SAR0 ditto ditto ditto DAR0 ditto ditto ditto
ADR
FFFFE210H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR0 ditto ditto ditto
ADR
FFFFE220H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR1 ditto ditto ditto CSR1 ditto ditto ditto SAR1 ditto ditto ditto DAR1 ditto ditto ditto
ADR
FFFFE230H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR1 ditto ditto ditto
DTCR0 ditto ditto ditto
DTCR1 ditto ditto ditto
ADR
FFFFE240H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR2 ditto ditto ditto CSR2 ditto ditto ditto SAR2 ditto ditto ditto DAR2 ditto ditto ditto
ADR
FFFFE250H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR2 ditto ditto ditto
ADR
FFFFE260H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR3 ditto ditto ditto CSR3 ditto ditto ditto SAR3 ditto ditto ditto DAR3 ditto ditto ditto
ADR
FFFFE270H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR3 ditto ditto ditto
DTCR2 ditto ditto ditto
DTCR3 ditto ditto ditto
ADR
FFFFE280H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR4 ditto ditto ditto CSR4 ditto ditto ditto SAR4 ditto ditto ditto DAR4 ditto ditto ditto
ADR
FFFFE290H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR4 ditto ditto ditto
ADR
FFFFE2A0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR5 ditto ditto ditto CSR5 ditto ditto ditto SAR5 ditto ditto ditto DAR5 ditto ditto ditto
ADR
FFFFE2B0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR5 ditto ditto ditto
DTCR4 ditto ditto ditto
DTCR5 ditto ditto ditto
TMP19A43(rev2.0)22-18 Table of Special Function Registers
TMP19A43
Little-endian
ADR
FFFFE2C0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR6 ditto ditto ditto CSR6 ditto ditto ditto SAR6 ditto ditto ditto DAR6 ditto ditto ditto
ADR
FFFFE2D0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR6 ditto ditto ditto
ADR
FFFFE2E0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
CCR7 ditto ditto ditto CSR7 ditto ditto ditto SAR7 ditto ditto ditto DAR7 ditto ditto ditto
ADR
FFFFE2F0H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BCR7 ditto ditto ditto
DTCR6 ditto ditto ditto
DTCR7 ditto ditto ditto
ADR
FFFFE300H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
DCR ditto ditto ditto RSR ditto ditto ditto
ADR
FFFFE310H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE320H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE330H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
DHR ditto ditto ditto
ADR
FFFFE340H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE350H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE360H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE370H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TMP19A43(rev2.0)22-19 Table of Special Function Registers
TMP19A43
Little-endian
[13] CS/WAIT controller
ADR
FFFFE400H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BMA0 ditto ditto ditto BMA1 ditto ditto ditto BMA2 ditto ditto ditto BMA3 ditto ditto ditto
ADR
FFFFE410H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE480H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
B01CS ditto ditto ditto B23CS ditto ditto ditto
ADR
FFFFE490H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
BEXCS ditto
[14] FLASH control
ADR
FFFFE510H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
SEQMOD ditto ditto ditto SEQCNT ditto ditto ditto ROMSEC1
ADR
FFFFE520H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
FLCS
ADR
FFFFE620H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
Attention
Reserved Reserved Reserved Reserved
Reserved Reserved Reserved Reserved Reserved Reserved Reserved Reserved
ROMSEC2
[15] ROM correction
ADR
FFFFE540H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADDREG0 ditto ditto ditto ADDREG1 ditto ditto ditto ADDREG2 ditto ditto ditto ADDREG3 ditto ditto ditto
ADR
FFFFE550H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADDREG4 ditto ditto ditto ADDREG5 ditto ditto ditto ADDREG6 ditto ditto ditto ADDREG7 ditto ditto ditto
ADR
FFFFE560H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADDREG8 ditto ditto ditto ADDREG9 ditto ditto ditto ADDREGA ditto ditto ditto ADDREGB ditto ditto ditto
ADR
FFFFE570H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
TMP19A43(rev2.0)22-20 Table of Special Function Registers
TMP19A43
Little-endian
[16] Clock timer
ADR
FFFFE700H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
ADR
FFFFE710H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
RTCCR
RTCREG ditto ditto ditto
[17] UART/HSIO
ADR Register name ADR Register name ADR Register name ADR
FFFFE840H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
FFFFE800H HSC0BUF 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH HBR0ADD HSC0MOD1 HSC0MOD2 HSC0EN HSC0RFC HSC0TFC HSC0RST HSC0TST HSC0FCNF HSC0CR HSC0MOD0 HBR0CR
FFFFE810H HSC1BUF 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH HBR1ADD HSC1MOD1 HSC1MOD2 HSC1EN HSC1RFC HSC1TFC HSC1RST HSC1TST HSC1FCNF HSC1CR HSC1MOD0 HBR1CR
FFFFE820H HSC2BUF 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH HBR2ADD HSC2MOD1 HSC2MOD2 HSC2EN HSC2RFC HSC2TFC HSC2RST HSC2TST HSC2FCNF HSC2CR HSC2MOD0 HBR2CR
[18] CG
ADR
FFFFEE00H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
SYSCR0 SYSCR1 SYSCR2 SYSCR3
ADR
FFFFEE10H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
IMCGA ditto ditto ditto IMCGB ditto ditto ditto IMCGC ditto ditto ditto IMCGD ditto ditto ditto
ADR
FFFFEE20H 1H 2H 3H
Register name
EICRCG ditto ditto ditto
ADR
FFFFEE40H 1H 2H 3H 4H 5H 6H 7H 8H 9H AH BH CH DH EH FH
Register name
4H NMIFLG 5H 6H 7H 8H 9H AH BH CH DH EH FH
TMP19A43(rev2.0)22-21 Table of Special Function Registers
TMP19A43
23. JTAG Interface
The TMP19A43 is equipped with the boundary scan interface that conforms to the Joint Test Action Group (JTAG) standard. This interface uses the industry-standard JTAG protocol (IEEE Standard 1149.1/D6). This chapter describes this JTAG interface with a mention of boundary scan, interface pins, interface signals, and test access ports (TAP).
23.1 Boundary Scan Overview
IC (Integrated Circuit) density is ever increasing, SMDs (Surface Mount Devices) continue to decrease in size, components are now mounted on both sides of printed circuit boards (PCBs), and there are considerable technical developments related to embedding holes. Conventional internal circuit testing techniques are dependent on the physical contact between internal circuitry and chips and, therefore, their limitations with respect to efficiency and accuracy are manifest. With the ever-increasing IC complexity, tests conducted to perform inspections on all chips integrated into an IC are becoming larger in scale, and it is becoming more difficult to design an efficient, reliable IC testing program. To overcome this difficulty in performing IC tests, the "boundary scan" circuit was developed. It is a group of shift registers called "boundary scan cells" established between pins and internal circuitry (see Fig. 23-1). These boundary scan cells are bypassed under normal conditions. When an IC goes into test mode, data is sent from the boundary scan cells through the shift register bus in response to the instruction given by a test program, and various diagnostic tests are executed. In IC tests, five signals TDI, TDO, TMS, TCK and TRST are used. These signals are explained in the next section.
Integrated circuit
Pins on IC package Boundary scan cells
Fig. 23-1 JTAG Boundary Scan Cells Note) The optional instructions IDCODE, USERCODE, INTEST and RUNBIST are not implemented in the TMP19A43.
TMP19A43(rev2.0) 23-1
JTAG Interface
TMP19A43
23.2 JTAG Interface Signals
JTAG interface signals are as follows (see Fig. 23-2): * * * * * TDI TDO TMS TCK TRST : To input JTAG serial data : To output JTAG serial data : To select JTAG test mode : To input JTAG serial clock : To input JTAG test reset
3 Instruction register
0
JTDI pin 0 JTDO pin TAP controller Bypass register
JTMS pin 296 Boundary scan register 0 JTCK pin
TRST pin
Fig. 23-2 JTAG Interface Signals and Registers The JTAG boundary scan mechanism (hereafter called "JTAG mechanism") enables testing of the processor, printed circuit boards connected to the processor, and connections between other components on printed circuit boards. The JTAG mechanism does not have a function of testing the processor itself.
TMP19A43(rev2.0) 23-2
JTAG Interface
TMP19A43
23.3 JTAG Controller and Registers
The following JTAG controller and registers are built into the processor: * * * * * Instruction register Boundary scan register Bypass register Device identification register Test Access Port (TAP) controller
In the JTAG basic mechanism, the TAP controller state machine monitors the signals input through the JTMS pin. As the JTAG mechanism starts operation, the TAP controller determines a test function to be executed by loading data into the JTAG instruction register (IR) and performing a serial data scan via the data register (DR), as shown in Table 23-1. When data is scanned, the state of the JTMS pin represents new specific data words and the end of data flow. The data register is selected according to data loaded into the instruction register.
23.3.1
Instruction Register
The JTAG instruction register consists of four cells, including shift registers. It is used to select either a test to be executed or a test data register to be accessed or to select both. Either the boundary scan register or the bypass register is selected according to combinations shown in Table 23-1. Table 23-1 Bit Configurations of the JTAG Instruction Register
Instruction code Most significant to least significant bit 0000 0001 0010 to 1110 1111 Instruction EXTEST SAMPLE/PRELOAD Reserved BYPASS Data register to be selected Boundary scan register Boundary scan register Reserved Bypass register
Fig. 23-3 shows the format of the instruction register.
3 MSB 2 1 LSB 0
Fig. 23-3 Instruction Register
TMP19A43(rev2.0) 23-3
JTAG Interface
TMP19A43
The instruction code is shifted from the least significant bit to the instruction register.
Most significant TDI Least significant TDO
Fig. 23-4 Direction of a Shift of the Instruction Code to the Instruction Register
23.3.2
Bypass Register
The bypass register has a one-bit width. If the TAP controller is in the Shift-DR state (bypass state), data at the TDI pin is shifted into the bypass register, and the output from the bypass register is shifted out to the TDO output pin. Simply put, the bypass register is a circuit for bypassing the devices in a serial boundary scan chain connected to the substrates that are not required for a test to be conducted. Fig. 23-5 shows the logical position of the bypass register in a boundary scan chain. If the bypass register is used, the speed of access to boundary scan registers in an active IC in a data path used for substrate level testing can be increased.
JTDI Bypass register Input to substrate JTDO Input from substrate JTDI JTDI JTDO JTDO
JTDO JTDI JTDO
JTDI
Pad cell of boundary scan register
IC package
Substrate
Fig. 23-5 Function of the Bypass Register
TMP19A43(rev2.0) 23-4
JTAG Interface
TMP19A43
23.3.3
Boundary Scan Register
The boundary scan register has inputs and outputs for some analog output signals, as well as all signals from the TMP19A43 except control signals. Pins of the TMP19A43 can drive any test patterns by scanning data into the boundary scan register in the Shift-DR state. After the boundary scan register goes into the Capture-DR state, data enters the processor, is shifted, and inspected. The boundary scan register forms a data path. It basically functions as a single shift register of 297-bit width. Cells in this data path are connected to all input and output pads of the TMP19A43. The TDI input is introduced to the least significant bit (LSB) in the boundary scan register. The most significant bit in the boundary scan register is taken out of the TDO output.
23.3.4
Test Access Port (TAP)
The test access port (TAP) consists of five signal pins: TRST, TDI, TDO, TMS, and TCK. Serial test data, instructions and test control signals are sent and received through these signal pins. Data is serially scanned into one of three registers (instruction register, bypass register and boundary scan register) via the TDI pin or it is scanned out from one of these three registers into the TDO pin, as shown in Fig. 23-6. The TMS input is used to control the state transitions of the main TAP controller state machine. The TCK input is a test clock exclusively for shifting serial JTAG data synchronously; it works independently of a chip core clock or a system clock.
TCK TMS and TDI are sampled on the rising edge of TCK. Data is serially scanned in. 3 Instruction register 0 TDO is sampled on the falling edge of TCK. Data is serially scanned out.
Instruction register
0
0 Bypass register TDI pin
0 Bypass register TDO pin
115 Boundary scan register
0
TMS pin
115 Boundary scan register
0
Fig. 23-6 JTAG Test Access Port Data through the TDI and TMS pins are sampled on the rising edge of the input clock signal TCK. Data through the TDO pin changes on the falling edge of the clock signal TCK.
TMP19A43(rev2.0) 23-5
JTAG Interface
TMP19A43 23.3.5 TAP Controller
In the processor, a 16-state TAP controller specified in the IEEE JTAG standard is implemented.
23.3.6
Controller Reset
To reset the state machine of the TAP controller, * * assert the TRST signal input (Low) to reset the TAP controller or continue to assert the input signal TMS by using the rising edge of the TCK input five times successively after clearing the reset state of the processor.
The reset state can be maintained by keeping TMS in an asserted state.
TMP19A43(rev2.0) 23-6
JTAG Interface
TMP19A43
23.3.7
State Transitions of the TAP Controller
Fig. 23-7 shows the state transitions of the TAP controller. The state of the TAP controller changes depending on which value TMS will select on the rising edge of TCK, 0 or 1. In this figure, the arrow shows a state transition and the value that TMS selects to execute each state transition is shown alongside of the arrow.
1 Test-Logic-Reset 0 0 Run-Test/Idle 1 Select-DR-Scan 1 Select-IR-Scan 1
0 Capture-DR
0 Capture-IR
1
1
0 Shift-DR 0
0 Shift-IR 0
1 Exit 1-DR 1
1 Exit 1-IR 1
0 Pause-DR 0
0 Pause-IR 0
1 0 Exit 2-DR 0
1 Exit 2-IR
1 Update-DR
1 Update-IR
1
0
1
0
Fig. 23-7 State Transition Diagram of the TAP Controller
TMP19A43(rev2.0) 23-7
JTAG Interface
TMP19A43
The TAP controller operates in each state described below. In Fig. 23-7, a column to the left is the data column and a column to the right is the instruction column. The data column represents the data register (DR), and the instruction column represents the instruction register (IR). * Test-Logic-Reset If the TAP controller is in a reset state, the device identification register is selected by default. The most significant bit in the boundary scan register is cleared to "0," and the output is disabled. The TAP controller remains in the Test-Logic-Reset state if TMS is "1." If "0" is input into TMS in the Test-Logic-Reset state, the TAP controller goes into the Run-Test/Idle state. Run-Test/Idle In the Run-Test/Idle state, the IC goes into test mode only if a specific instruction, such as the built-in self test (BIST) instruction, is issued. If an instruction that cannot be executed in the RunTest/Idle state has been issued, the test data register selected by the last instruction maintains the existing state. The TAP controller remains in the Run-Test/Idle state if TMS is "0." If "1" is input into TMS, the TAP controller goes into the Select-DR-Scan state. Select-DR-Scan The Select-DR-Scan state of the TAP controller is a transient state. In this state, the IC performs no operations. If "0" is input into TMS when the TAP controller is in the Select-DR-Scan state, the TAP controller goes into the Capture-DR state. If "1" is input into TMS, the instruction column goes into the Select-IR-Scan state. Select-IR-Scan The Select-IR-Scan state of the TAP controller is a transient state. In this state, the IC performs no operations. If "0" is input into TMS when the TAP controller is in the Select-IR-Scan state, the TAP controller goes into the Capture-IR state. If "1" is input into TMS, the TAP controller returns to the TestLogic-Reset state. Capture-DR If the data register selected by the instruction register has parallel inputs when the TAP controller is in the Capture-DR state, data is loaded into the data register in a parallel fashion. If the data register does not have parallel inputs or if data does not need to be loaded into the selected test data register, the data register maintains the existing state. If "0" is input into TMS when the TAP controller is in the Capture-DR state, the TAP controller goes into the Shift-DR state. If "1" is input into TMS, the TAP controller goes into the Exit 1-DR state.
*
*
*
*
TMP19A43(rev2.0) 23-8
JTAG Interface
TMP19A43
*
Shift-DR If the TAP controller is in the Shift-DR state, data is serially shifted out by the data register connected between TDI and TDO. If the TAP controller is in the Shift-DR state, the Shift-DR state is maintained while TMS is "0." If "1" is input into TMS, the TAP controller goes into the Exit 1-DR state. Exit 1-DR The Exit 1-DR state of the TAP controller is a transient state. If "0" is input into TMS when the TAP controller is in the Exit 1-DR state, the TAP controller goes into the Pause-DR state. If "1" is input into TMS, it goes into the Update-DR state. Pause-DR In the Pause-DR state, the shift operation performed by the data register selected by the instruction register is temporarily suspended. The instruction register and the data register maintain their existing state. The TAP controller remains in the Pause-DR state while TMS is "0." If "1" is input into TMS, it goes into the Exit 2-DR state. Exit 2-DR The Exit 2-DR state of the TAP controller is a transient state. If "0" is input into TMS when the TAP controller is in the Exit 2-DR state, the TAP controller returns to the Shift-DR state. If "1" is input into TMS, it goes into the Update-DR state. Update-DR In the Update-DR state, data is output in a parallel fashion from the data register having a parallel output synchronously to the rising edge of TCK. The data register with a parallel output latch does not output data during the shift operation; it outputs data only in the Update-DR state. If "0" is input into TMS when the TAP controller is in the Update-DR state, the TAP controller goes into the Run-Test/Idle state. If "1" is input into TMS, it goes into the Select-DR-Scan state. Capture-IR In the Capture-IR state, data is loaded into the instruction register in a parallel fashion. Data loaded is 0001. The Capture-IR state is used to test the instruction register. A malfunction of the instruction register can be detected by shifting out the data loaded. If "0" is input into TMS when the TAP controller is in the Capture-IR state, the TAP controller goes into the Shift-IR state. If "1" is input into TMS, it goes into the Exit 1-IR state. Shift-IR In the Shift-IR state, the instruction register is connected between TDI and TDO, and data loaded synchronously to the rising edge of TCK is serially shifted out. The TAP controller remains in the Shift-IR state while TMS is "0." If "1" is input into TMS, the TAP controller goes into the Exit 1-IR state. Exit 1-IR The Exit 1-IR state of the TAP controller is a transient state. If "0" is input into TMS when the TAP controller is in the Exit 1-IR state, the TAP controller goes into the Pause-IR state. If "1" is input into TMS, it goes into the Update-IR state.
*
*
*
*
*
*
*
TMP19A43(rev2.0) 23-9
JTAG Interface
TMP19A43
*
Pause-IR In the Pause-IR state, the shift operation performed by the instruction register is temporarily suspended. The existing state of the instruction register and that of the data register are maintained. The TAP controller remains in the Pause-IR state while TMS is "0." If "1" is input into TMS, it goes into the Exit 2-IR state.
*
Exit 2-IR The Exit 2-IR state of the TAP controller is a transient state. If "0" is input into TMS when the TAP controller is in the Exit 2-IR state, the TAP controller goes into the Shift-IR state. If "1" is input into TMS, it goes into the Update-IR state.
*
Update-IR In the Update-IR state, instructions shifted into the instruction register are updated by outputting them in a parallel fashion synchronously to the rising edge of TCK. If "0" is input into TMS when the TAP controller is in the Update-IR state, the TAP controller goes into the Run-Test/Idle state. If "1" is input into TMS, it goes into the Select-DR-Scan state.
Table 23-2 shows the boundary scan sequence relative to processor signals. Table 23-2 JTAG Scan Sequence Relative to the TMP19A43 Processor Pins
[TDI] 7: P94 14: PA2 21: PB1 28: BOOT 35: P01 42: P02 49: P12 56: P25 63: P57 70: P67 77:P42 84: P64 91:PG1 98:PH7 105:PH6 112:PC7 119:PF7 126:PD1 133:P76 140:P83 147:P70 1:P90 8: PE7 15: PA3 22: PB5 29: P32 36: P34 43: P11 50: P13 57: P24 64: P51 71: P66 78:P65 85: PG3 92:PG2 99:DCLK 106:PH0 113:PC6 120:PF4 127:PD2 134:P75 141:P73 148:PE0 2: PE5 9: P95 16: PA4 23:PB4 30: P36 37: P35 44: P03 51:P16 58: P23 65: P56 72:P54 79: P60 86: PG6 93:TOV 100:PCST4 107:PC3 114:PC5 121:PF5 128:PD3 135:P87 142:P82 149:PE1 [TDO] 3:P91 10: P97 17: PA7 24: PB0 31: P00 38: P30 45: P06 52:P17 59: P27 66: P50 73: P61 80:P44 87: PG7 94:PH3 101:PCST3 108: PC4 115:PC2 122:PF1 129:PD4 136:P74 143:P81 150:PE2 4: P93 11: P96 18:PA6 25: PB7 32: P37 39: P05 46: P14 53:P20 60: P26 67: P63 74: P41 81:P45 88:PG4 95:DINT 102: PCST2 109: PH5 116:PC0 123:PF2 130:PD5 137:P85 144:P80 151:PE3 5:PE6 12: PA0 19: PA5 26: PB6 33: P33 40:P10 47: P07 54:P21 61: P53 68: P62 75: P40 82: P46 89:PG5 96:PH2 103: PCST1 110: PH4 117:PF6 124:PF0 131:PD6 138:P86 145:P71 152:PE4 6:P92 13: PA1 20: PB2 27: PB3 34: P04 41: P31 48: P15 55:P22 62: P52 69: P55 76:P43 83: P47 90:PG0 97:PH1 104:PCST0 111: PC1 118:PF3 125:PD0 132:P77 139:P84 146:P72
Terminal list to which JTAG can be scanned.
TMP19A43(rev2.0) 23-10
JTAG Interface
TMP19A43
Instructions Supported by the JTAG Controller Cells
This section describes the instructions supported by the JTAG controller cells of the TMP19A43.
23.3.8
EXTEST Instruction
The EXTEST instruction is used for external interconnect test. If this instruction is issued, the BSR cells at output pins output test patterns in the Update-DR state, and the BSR cells at input pins capture test results in the Capture-DR state. Before the EXTEST instruction is selected, the boundary scan register is usually initialized using the SAMPLE/PRELOAD instruction. If the boundary scan register has not been initialized, there is the possibility that indeterminate data will be transmitted in the Update-DR state and bus conflicts may occur between ICs. Fig. 23-8 shows the flow of data while the EXTEST instruction is selected.
Boundary scan path
Input
Internal logic
Output
TDI
TDO
Fig. 23-8 Flow of Data While the EXTEST Instruction Is Selected The basic external interconnect test procedure is as follows: 1. 2. Initialize the TAP controller to put it in the Test-Logic-Reset state. Load the SAMPLE/PRELOAD instruction into the instruction register. This allows the boundary scan register to be connected between TDI and TDO. Initialize the boundary scan register by shifting in determinate data. Load the initial test data into the boundary scan register. Load the EXTEST instruction into the instruction register. Capture the data applied to the input pin and input it into the boundary scan register. Shift out the captured data while simultaneously shifting in the next test pattern. Output to the output pin the test pattern that was shifted into the boundary scan register for output.
3. 4. 5. 6. 7. 8.
Repeat steps 6 through 8 for each test pattern.
EXTEST Instruction CPU is working and note the terminal input, please when using it. EXTEST InstructionPlease test after releasing system reset when using it.
TMP19A43(rev2.0) 23-11
JTAG Interface
TMP19A43
23.3.9
SAMPLE and PRELOAD Instructions
The SAMPLE and PRELOAD instructions are used to connect TDI and TDO by way of the boundary scan register. Each instruction performs the function described below: * The SAMPLE instruction is used to monitor the I/O pad of an IC. While SAMPLE is monitoring the I/O pads, the internal logic is not disconnected from the I/O pins of an IC. This instruction is executed in the Capture-DR state. A main function of SAMPLE is to read values of the I/O pins of an IC at the rising edge of TCK during normal functional operation. Fig. 23-9 shows the flow of data while the SAMPLE instruction is selected.
Boundary scan path
Input
Internal logic
Output
TDI
TDO
Fig. 23-9 Flow of Data While SAMPLE Is Selected * The PRELOAD instruction is used to initialize the boundary scan register before selecting other instructions. For example, the boundary scan register is initialized using PRELOAD before selecting the EXTEST instruction, as previously explained. PRELOAD shifts data into the boundary scan register without affecting the normal operation of the system logic. Fig. 23-10 shows the flow of data while the PRELOAD instruction is selected.
Boundary scan path
Input
Internal logic
Output
TDI
TDO
Fig. 23-10 Flow of Test Data While PRELOAD Is Selected
TMP19A43(rev2.0) 23-12
JTAG Interface
TMP19A43
23.3.10 BYPASS Instruction
When conducting the type of test in which an IC does not need to be controlled or monitored, the BYPASS instruction is used to form the shortest serial path bypassing an IC by connecting the bypass register between JTDI and JTDO. The BYPASS instruction does not affect the normal operation of the system logic implemented on a chip. Data passes through the bypass register while the BYPASS instruction is selected, as shown in Fig. 23-11.
Bypass register TDI 1 bit TDO
Fig. 23-11 Flow of Data While the Bypass Register Is Selected
23.4 Points to Note
This section describes the points to note regarding JTAG boundary scan operations implemented in this processor. * * The X2 and X1 signal pads do not comply with JTAG. To reset the JTAG circuit, execute either of the following: Initialize the JTAG circuit by asserting TRST, and then deassert TRST. Set the TMS pin to "1," and supply TCK with more than 5 clocks.
TMP19A43(rev2.0) 23-13
JTAG Interface
TMP19A43
24. Various protecting functions
24.1 Overview
The ROM protect function for designating the internal ROM (flash) area as a read-protected area and the DSU protect function for prohibiting the use of DSU (DSU-Probe) are built into the TMP19A43. The read protect functions specifically include the following: * * * Flash protect function ROM data protect function DSU protect function
24.2 Features
24.2.1 Flash Protect Function
A built-in flash can prohibit the operation of writing and the deletion at every the block of every 128 Kbyte. This function is called the block protecting. To make the block protecting function effective, it protects it corresponding to the block where it wants to put protecting. The bit is made "1". The block protecting can be released by making the protecting bit "0". (Please see the chapter of the Flash operation explanation about the program method. )The protecting bit can be monitored by FLCS register < BLPRO3:0 > bit. The state to put protecting on all blocks is called the FLASH protecting. It is necessary to note it because all the protecting bits become "0" after automatically deleting all data of the flash when the protecting release operates after it puts it into the state of the LASH protection of 1F(operation that makes the protecting bit "0"). FLASH is always being protected in the mask version, and the FLASH protecting cannot be released. This function doesn't influence usual operation in the mask version. It is necessary to be protecting FLASH to make "ROM data protecting" and "DSU protecting" that will explain in the future effective.
TMP19A43 (rev2.0) 24-1
Various protecting functions
TMP19A43
24.2.2
ROM data Protect
As for ROM data protecting, the execution of the command to the flash is prohibited in the function it, and the flash version that limits reading data to building FLASH/ROM into. When ROM protecting register ROMSEC1 bit is "1", ROM data protecting becomes effective with FLASH protected. If instructions in the ROM area have been replaced with instructions in the RAM area in a PC by using the ROM correction function, a PC shows the instructions as residing in the flash ROM area. Because they actually reside in the RAM area, data cannot be read in a ROM protected state. To read data by using instructions held in the overwritten RAM area, it is necessary to write data to RAM by using a program available in the ROM area or to use other means. If the ROM area is put in a protected state, the following operations cannot be performed: * * * * * * * Using instructions placed in areas other than the ROM area to load or store the data taken from the ROM area Store to DMAC register (NMI by the bus error is generated. ) Loading or storing the data taken from the ROM area in accordance with EJTAG Using BOOT-ROM to load or store the data taken from the ROM area (FLASH only) Executing flash writer to load or store the data taken from the ROM area(FLASH only) Using instructions placed in areas other than the ROM area to access the registers (ROMSEC1, ROMSEC2) that concern the protection of the ROM area Executing the command to unprotect automatic blocking in writer mode, performing the flash command sequences other than the automatic blocking unprotect command sequence, and performing the flash command sequence in single or boot mode by specifying an address in the ROM area(FLASH only)
The following operations can be performed even if the ROM area is in a protected state: * * * * * Using instructions placed in the ROM area to load the data taken from the ROM area Using instructions placed in all areas to load the data taken from areas other than the ROM area Using instructions placed in all areas to make instructions branch off to the ROM area Performing PC trace (there are restrictions) or break on the ROM area in accordance with EJTAG Data transfer of ROM area by DMAC
TMP19A43 (rev2.0) 24-2
Various protecting functions
TMP19A43
24.2.3
DSU Protect
The DSU protecting function is a function for invalidating the connection of DSU-probe to enable third parties other than the user to read the data of a built-in flash easily. When SEQMOD register < DSUOFF > bit is "1", the DSU protecting becomes effective with FLASH protected. In the DSUOFF bit, the flash version, the mask version, and the state of the first stage are "1. "It enters the state of the DSU protecting as long as the FLASH protecting is always effective in the mask version, and the DSUOFF bit is not set to "0" by the user program. It doesn't enter the state of the DSU protecting if protecting is not put on all blocks of FLASH in the flash version. An initial state enters the state of the DSU protecting as well as the mask version when FLASH is being protected putting protecting on all blocks of FLASH. (note) The DSUOFF bit can be accessed only with the instruction put on built-in ROM in the state of ROM data protecting. It is necessary to note it because it is necessary to put the program of the DSU protecting release on built-in ROM.
TMP19A43 (rev2.0) 24-3
Various protecting functions
TMP19A43
24.3 Protect Configuration and Protect Statuses
19A43F
CS_DMAC ROMSEC1 ROM Data protect A bus error exception occurs NMI
Chip
If the bit is "1111" Flash d protect function SEQMOD DSU protect
During a write of data from areas other than internal ROM to the DMAC register
Protect bit FLCS
Fig. 24-1 Various Protect Statuses
Table 24-1 Protect Statuses in Each Mode
Protect bit setting FLCS ROM protect enable bit ROMSEC1 DSU protect enable bit SEQMOD Flash read protect status ROM protect status DSU protect status Read of flash from internal ROM Read of flash from areas other than internal ROM Clearing of ROM protect enable status (from ROM) Clearing of ROM protect enable status (from areas other than ROM) Clearing of DSU protect enable status (from ROM) Clearing of DSU protect enable status (from areas other than ROM) Issuing of the command to erase protect bits Issuing of commands other than the command to erase protect bits Writing of data to the DMAC setting register (from ROM) Writing of data to the DMAC setting register (from areas other than ROM) 1111 1 1 ON ON x *1 x *2 OFF x *1 x *2 ON 0 ON OFF OFF 1 0 0 1111 Don't Care Don't Care OFF OFF OFF
Single /single boot mode
x *3 x *4 x *5 x *4 x *5 *8 x *7 *8 x *7 *9
x *6
x *6
*1 : *2 : *3 : *4 : *5 : *6 : *7 : *8 :
The data of address "0xBFC0_0000" or "0xBFC0_0002" can be read. Stored data is masked. A write to registers cannot be executed (data in registers cannot be cleared). Stored data is masked. A write to registers cannot be executed (data in registers cannot be cleared). A command address is masked, and flash memory does not recognize commands. A command address is masked, and flash memory does not recognize commands. A bus error exception occurs (when making the DMAC register setting). Because a read of flash memory is prohibited, commands are not recognized. Because a read of flash memory is prohibited, issued commands are converted to the command for erasing the whole flash memory area and the command for erasing all protect bits.
TMP19A43 (rev2.0) 24-4
Various protecting functions
TMP19A43
24.4 Register
Flash control/status register This register shows the status of flash memory being monitored and the block protect status of flash memory. Table 24-2 Flash Control Register
7 6 5 4 3 FLCS Bit Symbol BLPRO3 BLPRO2 BLPRO1 BLPRO0 (0xFFFF_E520) Read/Write R R After reset 0 0 0 0 0 by power-on (1) (1) (1) (1) Function Protect area setting (in units of 128 KB) "0" is 0000: All blocks unprotected read. xxx1: Block 0 protected xx1x: Block 1 protected x1xx: Block 2 protected 1xxx: Block 3 protected MASK"1111" 15 14 13 12 11 Bit Symbol Read/Write R After reset 0 0 0 0 0 by power-on Function 23 22 21 20 19 Bit Symbol Read/Write R After reset 0 0 0 0 0 by power-on Function 31 30 29 28 27 Bit Symbol Read/Write R After reset 0 0 0 0 0 by power-on Function 2 1 ROMTYPE R R 0 0 (1) ROM "0" is identification bit read. 0: Flash 1: MROM 0 RDY/BSY R 1 Ready/Busy 0: In auto operation 1: Auto operation completed (MASK:"1") 8
10
9
0
0
0
18
17
16
0
0
0
26
25
24
0
0
0
Bit 0: Ready/Busy flag bit The RDY/BSY output is provided to identify the status of auto operation. This bit is a functional bit for monitoring this function by communicating with the CPU. If flash memory is in auto operation, "0" is output to show that flash memory is busy. As flash memory completes auto operation and goes into a ready state, "1" is output and the next command will be accepted. If the result of auto operation is faulty, this bit continues to output "0." It returns to "1" upon a hardware reset. (Note) Before issuing a command, make sure that flash memory is in a ready state. If a command is issued when flash memory is busy, a right command cannot be generated and there is the possibility that subsequent commands may not be able to be input. In this case, you must return to a normal functional state by executing a system reset or issuing a reset command.
Bit 2: ROM type identification bit This bit is used to identify the type of flash ROM or the type of mask ROM based on the value after a reset. Flash ROM: "0" Mask ROM: "1" Bit [7:4]: Protect bit (x: A combination setting can be made for each block) The protect bit (4-bit) value corresponds to the protect status of each block. If this bit is "1," the corresponding block is in a protected state. A protected block cannot be overwritten.
TMP19A43 (rev2.0) 24-5
Various protecting functions
TMP19A43
Table 24-3 ROM Protect Register
7 ROMSEC1 (0xFFFF_E518) Bit Symbol Read/Write After reset by power-on Function 6 5 4 R 0 "0" is always read. 3 2 1 0 RSECON R/W 1 ROM protect 1: ON 0: OFF (see note) 8
15 Bit Symbol Read/Write After reset by power-on Function 23 Bit Symbol Read/Write After reset by power-on Function 31 Bit Symbol Read/Write After reset by power-on Function
14
13
12
11 R 0
10
9
22
21
"0" is always read. 20 19 18 R 0
17
16
30
29
28
27 R 0
26
25
24
"0" is always read.
(Note)
This register is initialized only by power-on reset in the FLASH version. The mask version is usually initialized at each reset.
(Note)
To access this register, 32-bit access is required.
TMP19A43 (rev2.0) 24-6
Various protecting functions
TMP19A43
Table 24-4 ROM Protect Lock Register
7 ROMSEC2 Bit Symbol (0xFFFF_E51C) Read/Write After reset Function 15 Bit Symbol Read/Write After reset Function 23 Bit Symbol Read/Write After reset Function 31 Bit Symbol Read/Write After reset Function 30 29 22 21 14 13 6 5 4 3 2 1 0
W Undefined See note. 12 11 W Undefined See note. 20 19 W Undefined See note. 28 27 W Undefined See note.
10
9
8
18
17
16
26
25
24
(Note) (Note) (Note) (Note)
If this register is set to "0x0000_003D" after ROMSEC1 is set, appropriate bit values are automatically set in ROMSEC1. If the ROM area is protected, the registers ROMSEC1 and ROMSEC2 can be accessed only by using the instructions residing in the ROM area. To access this register, 32-bit access is required. This register is a write-only register. If it is read, values will be undefined.
TMP19A43 (rev2.0) 24-7
Various protecting functions
TMP19A43
Table 24-5 DSU Protect Mode Register
7 SEQMOD (0xFFFF_E510) Bit Symbol Read/Write After reset Function 15 Bit Symbol Read/Write After reset Function 23 Bit Symbol Read/Write After reset Function 31 Bit Symbol Read/Write After reset Function 30 29 28 22 21 14 13 6 5 4 R 0 "0" is always read. 12 11 10 9 3 2 1 0 DSUOFF R/W 1 1: DSU disabled 0: DSU enabled 8
R 0 "0" is always read. 20 19 R 0 27
18
17
16
26
25
24
R 0 "0" is always read.
(Note) (Note)
This register is initialized only by power-on reset in the FLASH version. The mask version is usually initialized at each reset. To access this register, 32-bit access is required.
Table 24-6 DSU Protect Control Register
7 SEQCNT (0xFFFF_E514) Bit Symbol Read/Write After reset Function Bit Symbol Read/Write After reset Function Bit Symbol Read/Write After reset Function Bit Symbol Read/Write After reset Function 6 5 4 3 2 1 0
DSECODE07 DSECODE06 DSECODE05 DSECODE04 DSECODE03 DSECODE02 DSECODE01 DSECODE00
15
14
13
W 0 Write "0x0000_00C5." 12 11 W 0 Write "0x0000_00C5." 20 19 W 0 Write "0x0000_00C5." 28 27 W 0 Write "0x0000_00C5."
10
9
8
DSECODE15 DSECODE14 DSECODE13 DSECODE12 DSECODE11 DSECODE10 DSECODE09 DSECODE08
23
22
21
18
17
16
DSECODE23 DSECODE22 DSECODE21 DSECODE20 DSECODE19 DSECODE18 DSECODE17 DSECODE16
31
30
29
26
25
24
DSECODE31 DSECODE30 DSECODE29 DSECODE28 DSECODE27 DSECODE26 DSECODE25 DSECODE24
(Note) (Note)
To access this register, 32-bit access is required. This register is a write-only register. If it is read, values will be undefined.
TMP19A43 (rev2.0) 24-8
Various protecting functions
TMP19A43
24.5 Proted-related / Release Settings
If it is necessary to overwrite flash memory or protect bits in a protected state, "automatic protect bit deletion" must be executed or the ROM protect function must be disabled. DSU cannot be used if it is in a protected state. Flash memory may go into a read-protected state after the automatic protect bit program is executed. In this case, it is necessary to set DSU-PROBE to "enable" before the automatic protect bit program is executed. The mask version is possible only the release of ROM security, and the protecting bit cannot be rewritten. If "automatic protect bit deletion" is executed when flash memory is in a read-protected state, flash memory is automatically initialized inside this device. Therefore, extra caution must be used when switching from one state to a read-protected state. (FLASH only)
24.5.1
Flash Protect Function
The flash protecting function cannot be released always effectively in the mask version.
It becomes effective by putting the block protecting on all of the four blocks in the flash version. The flash memory command sequence and protect bit program commands are used to enable or disable the flash read protect function. For further information, refer to the command sequence explained in the chapter describing the operations of flash memory. (notes concerning FLASH version) The protecting bit is cleared after all the data of the flash is deleted when the protecting bit release command is executed with the flash protected, and the flash protecting is released. In the state of ROM data protecting, explains as follows, the command execution to the flash is disregarded. It is necessary to release ROM data protecting first clearing the RSECON bit of ROM protecting register when the flash protecting is released with ROM protected.
TMP19A43 (rev2.0) 24-9
Various protecting functions
TMP19A43
24.5.2
ROM data Protect
ROM data protecting is effective the flash protecting and becomes effective at ROM protecting register ROMSEC1="1". After releasing reset, the RSECON bit is initialized by "1". The flash protecting is sure to enter the state of ROM data protecting in the mask version after releasing reset because it is always effective. It decides whether to enter the state of ROM data protecting by the state of the flash protecting in the flash version. When ROM protecting register is rewritten with ROM data protected, rewriting can be executed only from the program put on built-in ROM. Therefore, it is necessary to prepare the release program of ROM data protecting on built-in ROM.
ROMSEC1READ data ROMSEC1write data D ROMSEC1write CLK SD
reset
Q
D SD
Q
ROM protection
Powon reset(FLASH) resetMASK
ROMSEC2 = 0x0000_003D It is not possible to access it excluding built-in ROM at the time of ROM data
ROM data protecting is released by setting ROM protecting register ROMSEC1"0" when protecting is released, and writing protecting code "0x0000_003D" in ROM protecting lock register ROMSEC2. Moreover, ROM data protecting function can be set again by similarly setting ROM protecting register ROMSEC1"1" when ROM protecting is set, and writing protecting code "0x0000_003D" in ROM protecting lock register ROMSEC2. It is necessary to note the ROMSEC2 register because the reading data is different from original write data because of the register only for writing. The initialization of ROM protecting register is different in the flash version and the mask version. It provides with the power-on reset circuit in the flash version, ROM protecting register is initialized by power-on reset, and the value doesn't usually change in reset. It is usually initialized by reset in the mask version because power-on reset is not provided. It is necessary to note it in the mask version because it is usually initialized at each reset.
TMP19A43 (rev2.0) 24-10
Various protecting functions
TMP19A43
24.5.3
DSU Protect
DSU data protecting is effective the flash protecting and becomes effective at DSU protecting register SEQMOD="1". After releasing reset, the DSUOFF bit is initialized by "1". The flash protecting is sure to enter the state of DSU data protecting in the mask version after releasing reset because it is always effective. It decides whether to enter the state of ROM data protecting by the state of the flash protecting in the flash version. When DSU protecting register is rewritten with ROM data protected, rewriting can be executed only from the program put on built-in ROM. Therefore, it is necessary to prepare the release program of DSU data protecting on built-in ROM.
SEQMODREAD data SEQMODwrite data D SEQMODwrite CLK SD
reset
Q
D SD
Q
DSU protection
Powon reset(FLASH) resetMASK
SEQCNT = 0x0000_00C5 It is not possible to access it excluding built-in ROM at the time of ROM data
FLASH protection
DSU protecting is released by setting DSU protecting register SEQMOD"0" when protecting is released, and writing protecting code "0x0000_00C5" in ROM protecting lock register SEQCNT. Moreover, DSU protecting function can be set again by similarly setting ROM protecting register SEQMOD"1" when DSU protecting is set, and writing protecting code "0x0000_00C5" in DSU protecting lock register SEQCNT. It is necessary to note the SEQCNT register because the reading data is different from original write data because of the register only for writing. The initialization of DSU protecting register is different in the flash version and the mask version. It provides with the power-on reset circuit in the flash version, DSU protecting register is initialized by power-on reset, and the value doesn't usually change in reset. It is usually initialized by reset in the mask version because power-on reset is not provided. It is necessary to note it in the mask version because it is usually initialized at each reset.
TMP19A43 (rev2.0) 24-11
Various protecting functions
TMP19A43
24.5.4
ROM Protect Register: ROMSEC1
The ROM protect register is equipped with a power-on reset circuit. Caution must be exercised as data read from the ROMSEC1 bit is different from the actually written data. How data is processed is shown below. The mask version is usually initialized by reset though FLASH goods are initialized by power-on reset.
Read data from ROMSEC1 Write data to ROMSEC1 D ROMSEC1 write CLK SD Reset Q D Q ROM protect
SD Power-on reset
ROMSEC2 = 0x0000_003D If the ROM is in a protected state, access from areas other than the internal ROM is disabled.
Flash read protect function
24.5.5
DSU Protect Mode Register: SEQMOD
The DSU protect mode register is equipped with a power-on reset circuit. Caution must be exercised as data read from the SEQMOD bit is different from the actually written data. How data is processed is shown below. The mask version is usually initialized by reset though FLASH goods are initialized by power-on reset.
Read data from SEQMOD Write data to SEQMOD D SEQMOD write CLK Q D Q DSU protect
SD Reset
SD Power-on reset
DSUSEC2 = 0x0000_00C5
Flash read protect function
If the ROM is in a protected state, access from areas other than the internal ROM is disabled.
TMP19A43 (rev2.0) 24-12
Various protecting functions
TMP19A43
25.
Electrical Characteristics
The letter x in equations presented in this chapter represents the cycle period of the fsys clock selected through the programming of the SYSCR1.SYSCK bit. The fsys clock may be derived from either the high-speed or low-speed crystal oscillator. The programming of the clock gear function also affects the fsys frequency. All relevant values in this chapter are calculated with the high-speed (fc) system clock (SYSCR1.SYSCK = 0) and a clock gear factor of 1/fc (SYSCR1.GEAR[2:0] = 000).
25.1 Absolute Maximum Ratings
Parameter
Supply voltage
Symbol
VCC15
Rating
- 0.3to3.0 - 0.3to3.9 - 0.3to3.9 - 0.3to3.5 - 0.3to3.9 - 0.3toVCC + 0.3 5 50 -5 50 600 260 -40to125 -20 to 85 0 to 70 100
Unit
(Core)
Vcc3 I/O AVCC3A/D DAVCC DVCC3 Supply voltage Low-level Per pin output Total current High-level Per pin output Total current Power dissipation (Ta = 85C) (D/A)
V
VIN
IOL IOL IOH IOH PD TSOLDER TSTG TOPR NEW
V
mA
mW C C C cycle
Soldering temperature (10 s)
Storage temperature Operating Temperature Exceptduring Flash W/E During Flash W/E
Write/erase cycles
VCC15DVCC15CVCC15CVCCHVCC3DVCC3=CVCCL VSSDVSSAVSSCVSS=DAGND
Note:
Absolute maximum ratings are limiting values of operating and environmental conditions which should not be exceeded under the worst possible conditions. The equipment manufacturer should design so that no Absolute maximum rating value is exceeded with respect to current, voltage, power dissipation, temperature, etc. Exposure to conditions beyond those listed above may cause permanent damage to the device or affect device reliability, which could increase potential risks of personal injury due to IC blowup and/or burning.
TMP19A43 25-1
TMP19A43
25.2 DC ELECTRICAL CHARACTERISTICS (1/3)
Ta20 to 85
Parameter Symbol
DVCC15 CVCCH DAVCC fosc = 8to10MHz fs = 30kHzto34kHz fsys = 15KHzto34KHz 4MHzto40MHz
Rating
Min.
Typ. (Note 1)
Max.
Unit
Supply voltage
AVCC3 = 3.3V CVCCHDVCC15 DVCC3=CVCCL CVSSDVSS AVSS=DAGND=0V
1.35 2.3
1.65 2.7 V
DVCC3 CVCCL
2.7
3.6
P7 to P8 (Used as a port) Low-level input voltage
VIL1
2.7VAVCC33.6V
0.3 AVCC3
Normal port
VIL2
2.7VDVCC33.6V
0.3 DVCC3
Schmitt-Triggered port
VIL3
- 0.3 2.7VDVCC33.6V 0.2 DVCC3
V
X1 XT1
VIL4 VIL5
1.35VCVCC1.65V 2.7VCVCC3.6V
0.1 CVCCH 0.1 CVCCL
Note 1:
Ta = 25C, DVCC15=1.5V,DVCC3= AVCC3=3.3V,DVCC=2.5V, unless otherwise noted
TMP19A43 25-2
TMP19A43 Ta20 to 85
Parameter
P7 to P8 (Used as a port) Normal port High-level input voltage
Symbol
Rating
Min.
Typ. (Note 1)
Max.
Unit
VIH1
2.7VAVCC33.6V
0.7 AVCC3
Normal port
VIH2
2.7VDVCC33.6V
0.7 DVCC3
Schmitt-Triggered port
VIH3
2.7VDVCC33.6V
0.8 DVCC3
DVCC3 + 0.3 DVCC15+ 0.2 CVCCH+ 0.2 CVCCL+0.3
V
X1
VIH4 VIH4 VOL VOH
1.35VCVCCH1.65V
0.9 CVCCH
XT2 Low-level output voltage High-level output voltage
2.7VCVCCL3.6V IOL = 2mA IOH = - 2mA DVCC32.7V DVCC32.7V
0.9 CVCCL 0.4 2.4
V
Note 1:
Ta = 25C, DVCC15=1.5V,DVCC3= AVCC3=3.3V,DVCC=2.5V, unless otherwise noted
TMP19A43 25-3
TMP19A43
25.3 DC ELECTRICAL CHARACTERISTICS (2/3)
Ta20 to 85
Parameter Symbol
ILI Input leakage current
Rating
0.0 VIN DVCC15 0.0 VIN DVCC3 0.0 VIN AVCC3 0.0 VIN DAVCC
Min.
Typ. (Note 1)
Max. Unit
0.02
5 A
ILO Output leakage current
0.2 VIN DVCC15 - 0.2 0.2 VIN DVCC3 - 0.2 0.2 VIN AVCC3- 0.2 0.2 VIN DAVCC- 0.2 0.05 10
Pull-up resister at Reset
RRST
DVCC3= 2.7Vto3.6V
20
50
150
k
Schmitt-Triggered port
VTH
2.7VDVCC33.6V
0.3
0.6
V
Programmable pull-up/ pull-down resistor
PKH CIO
DVCC3 = 2.7V to3.6V fc = 1MHz
20
50
150
k
Pin capacitance (Except power supply pins)
10
pF
Note 1:
Ta = 25C, DVCC15=1.5V,DVCC3= AVCC3=3.3V,DVCC=2.5V, unless otherwise noted
TMP19A43 25-4
TMP19A43
25.4 DC ELECTRICAL CHARACTERISTICS (3/3)
DVCC15CVCCH1.35Vto1.65V, DAVCC=2.3Vto2.7V CVCCL= DVCC3AVCC32.7Vto3.6V,
Ta20 to 85
Parameter
NORMAL(Note 2): Gear = 1/1 IDLE(Doze) (Note 3) IDLE(Halt) (Note 3) SLOW (Note 4) SLEEP (Note 4) STOP ICC
Symbol
fsys =40 MHz (f
OSC
Rating
Min.
Typ. (Note 1)
50 20 18 140 30 27
Max.
74 29 28 995 985 980
Unit
= 10 MHz)
mA
fs = 32.768kHz fs = 32.768kHz
A A A
Note 1:
Ta = 25C, DVCC15=1.5V,DVCC3= AVCC3=3.3V,DVCC=2.5V, unless otherwise noted
(note1)
ICC NORMAL: Measured with the CPU dhrystone operating ( DSU is excluded.), RAM, FLASH. All functions operating. D/A and A/D excluded.
(note2)
ICC IDLE : Measured with all functions stoping.
(note3)
ICC SLOWSLEEP : Measured with RTC on low-speed
ICC The current where flows is included. DVCC15DVCC3CVCCHCVCCLAVCC3DAVCC
TMP19A43 25-5
TMP19A43
25.5 10-bit ADC Electrical Characteristics
DVCC15CVCCH1.35Vto1.65V, CVCCL= DVCC3AVCC3VREFH2.7Vto3.6V, DAVCC=2.3Vto2.7V,AVSS = DVSS ,Ta20 to 85 AVCC3 load capacitanc= 3.3F, VREFH load capacitanc= 3.3F Parameter
Analog reference voltage ( + ) Analog reference voltage ( - ) Analog input voltage Analog supply current A/D conversion Non-A/D conversion
Symbol
VREFH VREFL VAIN IREF
Rating
Min
2.7 AVSS VREFL
Typ
3.3 AVSS
Max
3.6 AVSS VREFH
Unit
V V V mA A mA
DVSS = AVSS = VREFL DVSS = AVSS = VREFL
4.5 0.02
5.5 5 3
supply current A/D conversion INL error DNL error Offset error Fullscale error INL error DNL error Offset error Fullscale error INL error DNL error Offset error Fullscale error INL error DNL error Offset error Fullscale error
Non-IREF
AIN resistance 600 AIN load capacitance30pF Conversion time1.15s
2 1 2 2
3 2 4 4 3 2 4 4 3 2 4 4 3 2 4 4 LSB
AIN resistance 600 AIN load capacitance0.1F Conversion time1.15s
2 1 2 2
AIN resistance 1.3k AIN load capacitance0.1F Conversion time1.15s
2 1 2 2
AIN resistance 10k AIN load capacitance0.1F Conversion time2.30s
2 1 2 2
(Note 1)
1LSB = (VREFH - VREFL) / 1024[V]
TMP19A43 25-6
TMP19A43
25.6 8bit D/A Electrical Characteristics
DVCC15CVCCH1.35V to 1.65V, DAVCC=2.3V to 2.7V CVCCL= DVCC3AVCC32.7V to 3.6V,
Parameter
Analog reference voltage ( + ) Analog supply current supply current Output current Range of output voltage Fullscale error = 1 n=0,1 = 0 n=0,1
Symbol
DAVREF
Rating
Min
2.3
Typ
2.5 1 0.02
Max
2.7 2 5 5
Unit
V mA A mA mA
IDREF
Icc IDA0IDA1 DA0DA1 1 DAGND0.3 2
DAVCC0.3 3
V LSB
(Note 1) 1LSB = (DAVREF - DAGND) / 256[V] (Note 2) IDREF current valu is in the Dual channel operation .
(Note 3) No guarantee about Relative accuracy in the Dual channel operation (Note 4) Load Maximum capacitance of each DAx pin is 100pF.
TMP19A43 25-7
TMP19A43
25.7 AC Electrical Characteristics
25.7.1 Multiplex Bus mode
(1) DVCC15CVCC151.35Vto1.65V, AVCC3= 2.7Vto3.6V DVCC3 2.7Vto3.6V DAVCC = 2.3Vto2.7V,Ta =20to85C No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
ALE width = 1 clock cycle, 2 programmed wait state Equation Parameter Symbol Min Max
tSYS tAL tLA tLL tLC tCL tACL tACH tCAR tADL tADH tRD tRR tHR tRAE x (1 + TW) -6 0 x- 6 25 x -11 x-8 x-6 x-8 x-8 2x - 11 2x - 11 x - 11 x (2 + TW+ALE) - 43 x (2 + TW+ALE) - 43 x (1 + TW) -40 69 0 19.0 14.0 17.0 19.0 17.0 17.0 39.0 39.0 14.0 82.0 82.0 35.0
40 MHz (fsys)(Note) Min Max
Unit
ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
System clock period (x) A0-A15 VALID TO ALE LOW A0-A15 HOLD AFTER ALE LOW ALE pulse width high ALE low to RD , WR or HWR asserted
RD , WR or HWR negated to ALE high
A0-A15 valid to RD , WR or HWR asserted A16-A23 valid to RD , WR or HWR asserted A16-A23 hold after
HWR negated RD , WR
or
A0-A15 valid to D0-D15 Data in A16-A23 valid to D0-D15 Data in
RD RD
asserted to D0-D15 data in width low
D0-D15 hold after RD negated
RD negated to next A0-A15 output
WR / HWR
width low
tWW tDW
HWR
x (1 + TW) - 6 x (1 + TW) - 11 x - 11 x+ x (ALE)(TW1)32 x+ x (ALE)(TW1)32 (TW - 3)-16 (TW - 1) - 29
69.0 64.0 14.0
ns ns ns
17
D0-D15 valid to WR or HWR negated after
WR
18 D0-D15 hold negated 19 20 21
or
tWD tAWH tAWL tCW
A16-A23 valid to WAIT input A0-A15 valid to WAIT input
WAIT hold after RD , WR or HWR asserted
43.0 43.0 9.0 46.0
ns ns ns
Note 1: No. 1 to 21
Internal 2 wait insertion ALE "1" Clock@40MHz TW = W + 2N
TW = 2 + 2*1 = 4 AC measurement conditions: Output levels: Input levels: High = 0.8DVCC3 V/Low 0.2DVCC3 V, CL = 30 pF High = 0.7DVCC3 V/Low 0.3DVCC3 V
, , 2N : Number of external wait insertion
W : Number of Auto wait insertion
TMP19A43 25-8
TMP19A43
No.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
ALE width = 1 clock cycles, 2 programmed wait state Parameter Symb ol
tSYS tAL tLA tLL tLC tCL tACL tACH tCAR tADL tADH tRD tRR tHR tRAE x (1 + TW) -6 0 x- 6
Equation Min
25 x -11 x-8 x-6 x-8 x-8 2x - 11 2x - 11 x - 11 x (2 + TW+ALE) - 43 x (2 + TW+ALE) - 43 x (1 + TW) -40
40 MHz (fsys)(Note) Max Min
14.0 17.0 19.0 17.0 17.0 39.0 39.0 14.0 82.0 82.0 35.0 69 0 19.0
Unit
ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Max
System clock period (x) A0-A15 VALID TO ALE LOW A0-A15 HOLD AFTER ALE LOW ALE pulse width high ALE low to RD , WR or HWR asserted
RD , WR or HWR negated to ALE high
A0-A15 valid to RD , WR or HWR asserted A16-A23 valid to RD , WR or HWR asserted A16-A23 hold after
HWR negated RD , WR
or
A0-A15 valid to D0-D15 Data in A16-A23 valid to D0-D15 Data in
RD RD
asserted to D0-D15 data in width low
D0-D15 hold after RD negated
RD negated to next A0-A15 output
WR / HWR
width low
tWW tDW
HWR
x (1 + TW) - 6 x (1 + TW) - 11 x - 11 x+ x (ALE)(TW1)32 x+ x (ALE)(TW1)32 (TW - 3)-16 (TW - 1) - 29
69.0 64.0 14.0
ns ns ns
17
D0-D15 valid to WR or HWR negated after
WR
18 D0-D15 hold negated 19 20 21
or
tWD tAWH tAWL tCW
A16-A23 valid to WAIT input A0-A15 valid to WAIT input
WAIT hold after RD , WR or HWR asserted
43.0 43.0 9.0 46.0
ns ns ns
Note 1: No. 1 to 21
Internal 2 wait insertion ALE "1" Clock@40MHz TW = W + 2N
TW = 2 + 2*1 = 4 AC measurement conditions: Output levels: Input levels: High = 0.8DVCC3 V/Low 0.2DVCC3 V, CL = 30 pF High = 0.7DVCC3 V/Low 0.3DVCC3 V
, , 2N : Number of external wait insertion
W : Number of Auto wait insertion
TMP19A43 25-9
TMP19A43
(1) Read cycle timing, ALE width = 1 clock cycle, 1 programmed wait state
5CLK/1BUS Cycle
InternalCLK S1i tLL ALE tAL tCL W1 S1 S2 Sw S3 S2 S1 S0 S1i
tLA AD0~15 D015 tADL tADH A16~23 tACH tACL tLC tRD tRR tCAR tRAE tHR
A015
RD
CS0~3
R/W
TMP19A43 25-10
TMP19A43
(2) Read cycle timing, ALE width = 1 clock cycle, 2 programmed wait state
6CLK/1BUS Cycle
InternalCLK
tLL
ALE
tAL
tCL
tLA
AD0~15
A015
D015 tADL tADH tHR
A16~23
tACH tACL
tLC
tRD
tRR
tCAR
tRAE
RD
CS0~3
R/W
TMP19A43 25-11
TMP19A43
(3) Read cycle timing, ALE width = 1 clock cycle, 4 programmed wait state
8CLK/1BUS Cycle
InternalCLK
ALE
AD0~15
A015
D015
AD16~23
RD
tCW CS0~3
R/W tAWL/H WAIT
TMP19A43 25-12
TMP19A43
(4) Read cycle timing, ALE width = 2 clock cycle, 1 programmed wait state
6CLK/1BUS Cycle
InternalCLK S1i S1x tLL ALE tAL tCL S1 Sw S2 S0 S1i
tLA AD0~15 A015 tADL tADH A16~23 tACH tACL tLC tRD tRR tRAE tHR D015
RD
CS0~3
R/W
TMP19A43 25-13
TMP19A43
(5) Read cycle timing, ALE width = 2 clock cycle, 4 programmed wait state
9CLK/1BUS Cycle
InternalCLK
S1x
S1
Sw
Sw
SwEx
Sw
S2
S0
S1x
ALE
AD0~15
A015
D015
AD16~23
RD
tCW CS0~3
R/W tAWL/H WAIT
TMP19A43 25-14
TMP19A43
(6)
Write cycle timing, ALE width = 2 clock cycles, zero wait state
5CLK/1BUS Cycle InternalCLK
tLL ALE tAL tCL
tLA AD0~15 A015 tDW tACH tACL tLC WR, HWR tWW tCAR D015 tWD
AD16~23
CS0~3
R/W
TMP19A43 25-15
TMP19A43
(7)
Write cycle timing, ALE width = 1 clock cycles, 2 wait state
6CLK/1BUS Cycle
InternalCLK
tLL
ALE
tAL
tCL
tLA
AD0~15
A015
tDW
D015
tWD
AD16~23
tACH tACL
tLC
WR, HWR
tWW
tCAR
CS0~3
R/W
TMP19A43 25-16
TMP19A43
(8)
Write cycle timing, ALE width = 2 clock cycles, 4 wait state
9CLK/1BUS Cycle
InternalCLK
tLL
ALE
tAL
tCL
tLA
AD0~15
A015
tDW
D015
tWD
AD16~23
tACH tACL
tLC
WR, HWR
tWW
tCAR
tCW
CS0~3
R/W
tAWL/H
WAIT
TMP19A43 25-17
TMP19A43
25.7.2 Separate Bus mode
(1) DVCC15CVCCH1.35Vto1.65V, DVCC3AVCC3=2.7Vto3.6V, DAVCC =2.3 Vto2.7V, Ta = 20 to 85C No. SYSCR3 = "0", 2 programmed wait state Parameter Symb ol
tSYS or HWR tAC tCAR tAD tRD tRR tHR tRAE tWW tDO tDW tWD tAW tCW (TW - 3)-16 x (1 + TW) - 11 x - 11 x+ x (ALE)(TW1)32 (TW - 1) - 29 9.0
WR
Equation Min
25 X(1ALE) -11 x - 11 x (2 + TW+ALE) - 43 x (1 + TW) - 40 x (1 +TW) -6 0 x-6 x (1 + TW) -6 9.7
40 MHz (fsys)(Note) Max Min
39.0 14.0 82.0 35.0 69.0 0 19.0 69.0 9.7 64.0 14.0
Unit
ns ns ns ns ns ns ns ns ns ns ns ns
Max
1 System clock period (x) 2 A0-A23 valid to RD , WR asserted
3 A0-A23 hold after RD , WR or HWR negated 4 A0-A23 valid to D0-D15 Data in 5 RD asserted to D0-D15 data in 6 RD width low 7 D0-D15 hold after RD negated 8 RD negated to next A0-A23 output 9 WR /HWR 11 D0-D15 hold negated 12 D0-D15 negated hold width low after after or
HWR
10 WR or HWR asserted to D0-D15 valid
WR
or HWR
13 A0-A23 valid to WAIT input 14
WAIT hold after RD , WR or HWR asserted
43.0 46.0
ns ns
Note 1: No. 1 to 14
Internal 2 wait insertion ALE "1" Clock@40MHz TW = W + 2N
TW = 2 + 2*1 = 4 AC measurement conditions: Output levels: Input levels: High = 0.8DVCC3 V/Low 0.2DVCC3 V, CL = 30 pF High = 0.7DVCC3 V/Low 0.3DVCC3 V
, , 2N : Number of external wait insertion
W : Number of Auto wait insertion
TMP19A43 25-18
TMP19A43
(1)
Read cycle timing (SYSCR3 = 0, 1 programmed wait state)
4CLK/1BUS Cycle
InternalCLK S1 Sw S2 S0 S1
CS0~3 tAD tAC tHR
A0~23
D0~15
D015
tRR tRD
tCAR tRAE
RD
R/W
TMP19A43 25-19
TMP19A43
(2) Read cycle timing (SYSCR3 = 1, 1 programmed wait state)
5CLK/1BUS Cycle
InternalCLK S1i S1 Sw S2 S0 S1i
CS0~3 tAD tAC
A16~23
tAD D0~15
tHR D015
tRR tRD
tCAR tRAE
RD
R/W
TMP19A43 25-20
TMP19A43
(3)Read cycle timing SYSCR3 = 1, 4 externally generated wait states with N = 1)
8CLK/1BUS Cycle
InternalCLK S1 Sw Sw SwE Sw S2 S0 S1i
CS0~3
A0~23
D0~15
D015
RD
tCW
R/W
tAW WAIT
TMP19A43 25-21
TMP19A43
(4)
Write cycle timing (SYSCR3 = 1, zero wait sate)
4CLK/1BUS Cycle
InternalCLK
CS0~3
A0~23
tAC
tDW D0~15 tDO tWW WR, HWR D015
tWD
tCAR
R/W
TMP19A43 25-22
TMP19A43
(5)
Write cycle timing (SYSCR3 =1, 4 wait state)
4CLK/1BUS Cycle
InternalCLK
CS0~3
tAC A0~23
tDW D0~15 tDO tWW WR, HWR D015
tWD
tCAR
R/W
WAIT
TMP19A43 25-23
TMP19A43
(6)
Write cycle timing (SYSCR3 = 1, 5 wait state)
4CLK/1BUS Cycle
InternalCLK
CS0~3
tAC A0~23
tDW D0~15 tDO tWW WR, HWR D015
tWD
tCAR
R/W
WAIT
TMP19A43 25-24
TMP19A43
25.8 Transfer with DMA Request
The following shows an example of a transfer between the on-chip RAM and an external device in multiplex bus mode. * * * * 16-bit data bus width, non-recovery time Level data transfer mode Transfer size of 16 bits, device port size (DPS) of 16 bits Source/destination: on-chip RAM/external device
The following shows transfer operation timing of the on-chip RAM to an external bus during write operation (memory-to-memory transfer).
Internal GCLKIN
tDREQ_w DREQn tDREQ_r AD[15:0]
Add Data Add
tDREQ_w
tDREQ_r
Data Add Data
(N-1)transfer ALE HWR LWR CS R/W
N transfer
(N+1)transfe
GBSTART GACK
2Clk 2Clk
(1) Indicates the condition under which Nth transfer is performed successfully. (2) Indicates the condition under which (N + 1)th transfer is not performed.
TMP19A43 25-25
TMP19A43
DVCC15CVCCH1.35Vto1.65V, DVCC3AVCC3=2.7Vto3.6V, DAVCC =2.3 Vto2.7V, Ta = 20to85C Equation Parameter Symbol Min
RD asserted to DREQn negated (external device to on-chip RAM transfer)
40 MHz (fsys) Min
50 -75
Unit
Max
2WALE8x 51 5+WAITx51.8
Max
224 98.2 ns ns
tDREQ_r tDREQ_w
W+1x -(W+2)x
WR / HWR rising to DREQn negated
(on-chip RAM to external device transfer)
TMP19A43 25-26
TMP19A43
25.9 Serial Channel Timing
(1) I/O Interface modeDVCC32.7Vto3.6V In the table below, the letter x represents the fsys cycle period, which varies depending on the programming of the clock gear function. SCLK input modeSIO0 to SIO2 Parameter
SCLK period SCLK Clock High width(input) SCLK Clock Low width (input) TxD data to SCLK rise or fall* TxD data hold after SCLK rise or fall* RxD data valid to SCLK rise or fall* RxD data hold after SCLK rise or fall*
Sym bol
tSCY TscH TscL tOSS tOHS tSRD tHSR 12x 6x 6x 2x-30 8x-15 30 2x+30
Equation Min Max
300 150 150 20 185 30 80
40 MHz Min Max
Unit
ns ns ns ns ns ns ns
* SCLK rise or fall: Measured relative to the programmed active edge of SCLK. SCLK output mode Parameter
SCLK period TxD data to SCLK rise or fall* TxD data hold after SCLK rise or fall* RxD data valid to SCLK rise or fall* RxD data hold after SCLK rise or fall*
SIO0 to SIO2 Sym bol
tSCY tOSS tOHS tSRD tHSR 8x 4x-10 4x-10 45 0
Equation
Min Max 200 90 90 45 0
40 MHz
Min Max
Unit
ns ns ns ns ns
tSCY
SCLK SCK Output Mode/ Active-High SCL Input Mod SCLK Active-Low SCK Input Mode
tOSS 0 tSRD 1
tOHS 2 tHSR 1 VALID 2 VALID 3 VALID 3
OUTPUT DATA TxD
INPUT DATA RxD
0 VALID
TMP19A43 25-27
TMP19A43
25.10 High Speed Serial Channel Timing
(1) I/O Interface modeDVCC32.7V to 3.6V In the table below, the letter x represents the fsys cycle period, which varies depending on the programming of the clock gear function. HSCLK input modeHSIO0 to HSIO2 Parameter
HSCLK period HSCLK Clock High width(input) HSCLK Clock Low width (input) TxD data to HSCLK rise or fall* TxD data hold after HSCLK rise or fall* RxD data valid to HSCLK rise or fall* RxD data hold after HSCLK rise or fall*
Sym bol
tSCY TscH TscL tOSS tOHS tSRD tHSR 12(x/2) 3x 3x
Equation Min Max
150 75 75 -5 85 30 55
40 MHz Min Max
Unit
ns ns ns ns ns ns ns
2(x/2)-30 8(x/2)-15 30 2(x/2)+30
* HSCLK rise or fall: Measured relative to the programmed active edge of HSCLK. HSCLK output mode Parameter
HSCLK period TxD data to HSCLK rise or fall* TxD data hold after HSCLK rise or fall* RxD data valid to HSCLK rise or fall* RxD data hold after HSCLK rise or fall*
HSIO0 to HSIO2 Sym bol
tSCY tOSS tOHS tSRD tHSR 8(x/2) 4(x/2)-10 4(x/2)-10 45 0
Equation Min Max
100 40 40 45 0
40 MHz Min Max
Unit
ns ns ns ns ns
tSCY
SCLK SCK Output Mode/ Active-High SCL Input Mod SCLK Active-Low SCK Input Mode
tOSS 0 tSRD 1
tOHS 2 tHSR 1 VALID 2 VALID 3 VALID 3
OUTPUT DATA TxD
INPUT DATA RxD
0 VALID
TMP19A43 25-28
TMP19A43
25.11
SBI Timing
(1) I2C mode In the table below, the letters x represent the fsys periods, respectively. n denotes the value of n programmed into the SCK (SCL output frequency select) field in the SBI0CR.
Parameter SCL clock frequency Hold time for START condition SCL clock low width (Input) (Note 1)
Symbol tSC tHD:STA tLOW
Equation Min 0 Max
Standard mode Min 0 4.0 4.7 4.0 4.7 0.0 250 4.0 Max 100
Fast mode Min 0 0.6 1.3 0.6 0.6 0.0 100 0.6 1.3 Max 400
Unit kHz s s s s s ns s s
SCL clock high width (Output) (Note 2) tHIGH Setup time for a repeated START tSU;STA (Note 5) condition Data hold time (Input) (Note 3, 4) Data setup time Setup time for STOP condition tHD;DAT tSU;DAT tSU;STO (Note 5)
Bus free time between STOP and tBUF START conditions
4.7
Note 1: Note 2:
SCL clock low width (output) is calculated with: (2n-1 +58)/(fsys/2) SCL clock high width (output) is calculated with (2n-1 +12)/(fsys/2)
Notice: On I2C-bus specification, Maximum Speed of Standard Mode is 100KHz ,Fast mode is 400Khz. Internal SCL clock Frequency setting should be shown above Note1 & Note2. Note 3: The output data hold time is equal to 12x
Note 4: The Philips I2C-bus specification states that a device must internally provide a hold time of at least 300 ns for the SDA signal to bridge the undefined region of the fall edge of SCL. However, this SBI does not satisfy this requirement. Also, the output buffer for SCL does not incorporate slope control of the falling edges; therefore, the equipment manufacturer should design so that the input data hold time shown in the table is satisfied, including tr/tf of the SCL and SDA lines.
Note 5:
Software-dependent
tSCL tf SCL tHD;STA SDA S S: START condition Sr: Repeated START condition P: STOP condition Sr P tSU;DAT tHD;DAT tSU;STA tSU;STO tBUF tLOW tr tHIGH
TMP19A43 25-29
TMP19A43
(2) Clock-Synchronous 8-Bit SIO mode In the tables below, the letters x represent the fsys cycle periods, respectively. The letter n denotes the value of n programmed into the SCK (SCL output frequency select) field in the SBI0CR1. The electrical specifications below are for an SCK signal with a 50% duty cycle. SCK Input mode Parameter
SCK period SCK Clock High width(input) SCKClock Low width(input) SO data to SCK rise SO data hold after SCK rise SI data valid to SCK rise SI data hold after SCK rise
Symb ol
tSCY TscH TscH tOSS tOHS tSRD tHSR 16x 8x 8x
Equation Min Max
40 MHz Min
400 200 200
Max
Unit
ns ns ns ns ns ns ns
(tSCY/2) - (6x + (tSCY/2) + 4x 0 4x + 10
20)
30 300 0 110
SCK Output mode Parameter
SCK period (programmable) SO data to SCK rise SO data hold after SCK rise SI data valid to SCK rise SI data hold after SCK rise
Symb ol
tSCY tOSS tOHS tSRD tHSR
Equation Min
2 T (tSCY/2) - 20 (tSCY/2) - 20 2x + 30 0
n
40 MHz Max Min
800 380 T380 55 0
Max
Unit
ns ns ns ns ns
tSCY SCLK tOSS OUTPUT DATA TxD 0 tSRD INPUT DATA TxD 0 VALID 1 VALID 1
tSCH tSCL tOHS 2 tHSR 2 VALID 3 VALID 3
TMP19A43 25-30
TMP19A43
25.12
Event Counter
In the table below, the letter x represents the fsys cycle period. Parameter Symbol
tVCKL tVCKH
Equation Min
2X + 100 2X + 100
40 MHz Min
150 150
Max
Max
Unit
ns ns
Clock low pulse width Clock high pulse width
25.13 Timer Capture
In the table below, the letter x represents the fsys cycle period. Parameter
Low pulse width High pulse width
Symbol
tCPL tCPH
Equation Min
2X + 100 2X + 100
40 MHz Min
150 150
Max
Max
Unit
ns ns
25.14
General Interrupts
In the table below, the letter x represents the fsys cycle period. Parameter Symbol
tINTAL tINTAH
Equation Min
X + 100 X + 100
40 MHz Min
125 125
Max
Max
Unit
ns ns
Low pulse width for INT0-INTA High pulse width for INT0-INTA
25.15
STOP /SLEEP/SLOW Wake-up Interrupts
Parameter Symbol
tINTBL tINTBH
Equation Min
100 100
40 MHz Min
100 100
Max
Max
Unit
ns ns
Low pulse width for INT0-INTB High pulse width for INT0-INTB
25.16
SCOUT Pin
Parameter Symbol
tSCH tSCL
Equation Min
0.5T - 5 0.5T - 5
40 MHz Min
7.5 7.5
Max
Max
Unit
ns ns
Clock high pulse width
Clock low pulse width
Note: In the above table, the letter T represents the cycle period of the SCOUT output clock.
tSCH SCOUT tSCL
TMP19A43 25-31
TMP19A43
25.17 Bus Request and Bus Acknowledge Signals
BUSRQ
(Note1)
BUSAK
tBAA tABA AD0~AD15 (Note2)
A0~A23, RD , WR
(Note2)
CS0 ~ CS3 ,
R / W , HWR
ALE
Parameter
Bus float to BUSAK asserted Bus float after BUSAK negated
Symbol
tABA tBAA
Equation Min
0 0
40 MHz Min
0 0
Max
80 80
Max
80 80
Unit
ns ns
Note 1: If the current bus cycle has not terminated due to wait-state insertion, the TMP19A43FDXBG does not respond to BUSRQ until the wait state ends. Note 2: This broken line indicates that output buffers are disabled, not that the signals are at indeterminate states. The pin holds the last logic value present at that pin before the bus is relinquished. This is dynamically accomplished through external load capacitances. The equipment manufacturer may maintain the bus at a predefined state by means of off-chip restores, but he or she should design, considering the time (determined by the CR constant) it takes for a signal to reach a desired state. The on-chip, integrated programmable pullup/pulldown resistors remain active, depending on internal signal states.
TMP19A43 25-32
TMP19A43
25.18
KWUP Input
Parameter
Low pulse width for KEY High pulse width for KEY
Symbol
tkyTBL tkyTBH
Equation Min
100 100
40 MHz Min
100 100
Max
Max
Unit
ns ns
25.19 Dual Pulse Input
Parameter
Dual input pulse period Dual input pulse setup
Symbol
Tdcyc Tabs Tabh
Equation Min
8Y Y20 Y20
40 MHz Min
400 70 70
Max
Max
Unit
ns ns ns
Dual input pulse hold Y : fsys/
A Tabs B Tabh Tdcyc
25.20
ADTRG input
Equation Min
fsys/2 20 fsys/2 20
Parameter
Low pulse width for ADTRG High pulse width for ADTRG
Symbol
tadL Tadh
40 MHz Min
32.5 32.5
Max
Max
Unit
ns ns
TMP19A43 25-33
TMP19A43
25.21 DSU
Equation Min
11 0.5 11 0.5 11 0.5
Parameter
PCST valid to DCLK negated PCST hold after DCLK negated TPC valid to DCLK negated TPC hold after DCLK negated TPD valid to DCLK negated TPD hold after DCLK negated
Symbol
Tsetup Thold Tsetup Thold Tsetup Thold
40 MHz Min
11 0.5 11 0.5 11 0.5
Max
Max
Unit
ns ns ns ns ns ns
Ttclk DCLK Tsetup OUTPUT DATA PCST,TPC,TPD 0 1 Thold 2 3
25.22 EJTAG
Equation Min
40 50 10
Parameter
TCK valid to TMS/TDI Data in TMS/TDI hold after TCK negated TDO hold after TCK asserted
Symbol
Ttsetup Tthold Ttout
10 MHz() Min
40 50 10
Max
Max
Unit
ns ns ns
Operating Frequency of TCK is 10MHz Only
Ttclk TCK
tTsetup
INPUT DATA TMS,TDI
tThold 1 VALID 2 VALID 3 VALID
0
VALID
OUTPUT DATA TDO
tTOUT
TMP19A43 25-34


▲Up To Search▲   

 
Price & Availability of TMP19A43CZXBG

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X